Exemplo n.º 1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TRange struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(6);
   if (incoming.get(0)) {
     struct.start = new TKey();
     struct.start.read(iprot);
     struct.setStartIsSet(true);
   }
   if (incoming.get(1)) {
     struct.stop = new TKey();
     struct.stop.read(iprot);
     struct.setStopIsSet(true);
   }
   if (incoming.get(2)) {
     struct.startKeyInclusive = iprot.readBool();
     struct.setStartKeyInclusiveIsSet(true);
   }
   if (incoming.get(3)) {
     struct.stopKeyInclusive = iprot.readBool();
     struct.setStopKeyInclusiveIsSet(true);
   }
   if (incoming.get(4)) {
     struct.infiniteStartKey = iprot.readBool();
     struct.setInfiniteStartKeyIsSet(true);
   }
   if (incoming.get(5)) {
     struct.infiniteStopKey = iprot.readBool();
     struct.setInfiniteStopKeyIsSet(true);
   }
 }
Exemplo n.º 2
0
 @Override
 public void clear() {
   this.start = null;
   this.stop = null;
   setStartKeyInclusiveIsSet(false);
   this.startKeyInclusive = false;
   setStopKeyInclusiveIsSet(false);
   this.stopKeyInclusive = false;
   setInfiniteStartKeyIsSet(false);
   this.infiniteStartKey = false;
   setInfiniteStopKeyIsSet(false);
   this.infiniteStopKey = false;
 }
Exemplo n.º 3
0
 public TRange(
     TKey start,
     TKey stop,
     boolean startKeyInclusive,
     boolean stopKeyInclusive,
     boolean infiniteStartKey,
     boolean infiniteStopKey) {
   this();
   this.start = start;
   this.stop = stop;
   this.startKeyInclusive = startKeyInclusive;
   setStartKeyInclusiveIsSet(true);
   this.stopKeyInclusive = stopKeyInclusive;
   setStopKeyInclusiveIsSet(true);
   this.infiniteStartKey = infiniteStartKey;
   setInfiniteStartKeyIsSet(true);
   this.infiniteStopKey = infiniteStopKey;
   setInfiniteStopKeyIsSet(true);
 }
Exemplo n.º 4
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TRange 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.STRUCT) {
              struct.start = new TKey();
              struct.start.read(iprot);
              struct.setStartIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // STOP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.stop = new TKey();
              struct.stop.read(iprot);
              struct.setStopIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // START_KEY_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.startKeyInclusive = iprot.readBool();
              struct.setStartKeyInclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // STOP_KEY_INCLUSIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.stopKeyInclusive = iprot.readBool();
              struct.setStopKeyInclusiveIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // INFINITE_START_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.infiniteStartKey = iprot.readBool();
              struct.setInfiniteStartKeyIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // INFINITE_STOP_KEY
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.infiniteStopKey = iprot.readBool();
              struct.setInfiniteStopKeyIsSet(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
      struct.validate();
    }
Exemplo n.º 5
0
 public TRange setInfiniteStartKey(boolean infiniteStartKey) {
   this.infiniteStartKey = infiniteStartKey;
   setInfiniteStartKeyIsSet(true);
   return this;
 }