コード例 #1
0
ファイル: SliceRange.java プロジェクト: Colex/cassandra-mv
    public void read(org.apache.thrift.protocol.TProtocol iprot, SliceRange struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // START
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.start = iprot.readBinary();
              struct.setStartIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FINISH
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.finish = iprot.readBinary();
              struct.setFinishIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // REVERSED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.reversed = iprot.readBool();
              struct.setReversedIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // COUNT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.count = iprot.readI32();
              struct.setCountIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      if (!struct.isSetReversed()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'reversed' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetCount()) {
        throw new org.apache.thrift.protocol.TProtocolException(
            "Required field 'count' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }
コード例 #2
0
ファイル: SliceRange.java プロジェクト: thanodnl/libcassandra
  public void read(TProtocol iprot) throws TException {
    TField field;
    iprot.readStructBegin();
    while (true) {
      field = iprot.readFieldBegin();
      if (field.type == TType.STOP) {
        break;
      }
      switch (field.id) {
        case 1: // START
          if (field.type == TType.STRING) {
            this.start = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 2: // FINISH
          if (field.type == TType.STRING) {
            this.finish = iprot.readBinary();
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 3: // REVERSED
          if (field.type == TType.BOOL) {
            this.reversed = iprot.readBool();
            setReversedIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        case 4: // COUNT
          if (field.type == TType.I32) {
            this.count = iprot.readI32();
            setCountIsSet(true);
          } else {
            TProtocolUtil.skip(iprot, field.type);
          }
          break;
        default:
          TProtocolUtil.skip(iprot, field.type);
      }
      iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    if (!isSetReversed()) {
      throw new TProtocolException(
          "Required field 'reversed' was not found in serialized data! Struct: " + toString());
    }
    if (!isSetCount()) {
      throw new TProtocolException(
          "Required field 'count' was not found in serialized data! Struct: " + toString());
    }
    validate();
  }
コード例 #3
0
ファイル: SliceRange.java プロジェクト: thanodnl/libcassandra
 public SliceRange(byte[] start, byte[] finish, boolean reversed, int count) {
   this();
   this.start = start;
   this.finish = finish;
   this.reversed = reversed;
   setReversedIsSet(true);
   this.count = count;
   setCountIsSet(true);
 }
コード例 #4
0
ファイル: SliceRange.java プロジェクト: Colex/cassandra-mv
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, SliceRange struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   struct.start = iprot.readBinary();
   struct.setStartIsSet(true);
   struct.finish = iprot.readBinary();
   struct.setFinishIsSet(true);
   struct.reversed = iprot.readBool();
   struct.setReversedIsSet(true);
   struct.count = iprot.readI32();
   struct.setCountIsSet(true);
 }
コード例 #5
0
ファイル: SliceRange.java プロジェクト: thanodnl/libcassandra
 public SliceRange setCount(int count) {
   this.count = count;
   setCountIsSet(true);
   return this;
 }