Exemple #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);
   }
 }
Exemple #2
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();
    }