@Override
 public void read(org.apache.thrift.protocol.TProtocol prot, RebalanceOptions struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.wait_secs = iprot.readI32();
     struct.setWait_secsIsSet(true);
   }
   if (incoming.get(1)) {
     struct.num_workers = iprot.readI32();
     struct.setNum_workersIsSet(true);
   }
   if (incoming.get(2)) {
     {
       org.apache.thrift.protocol.TMap _map322 =
           new org.apache.thrift.protocol.TMap(
               org.apache.thrift.protocol.TType.STRING,
               org.apache.thrift.protocol.TType.I32,
               iprot.readI32());
       struct.num_executors = new HashMap<String, Integer>(2 * _map322.size);
       for (int _i323 = 0; _i323 < _map322.size; ++_i323) {
         String _key324; // required
         int _val325; // required
         _key324 = iprot.readString();
         _val325 = iprot.readI32();
         struct.num_executors.put(_key324, _val325);
       }
     }
     struct.setNum_executorsIsSet(true);
   }
 }
 @Override
 public void clear() {
   setWait_secsIsSet(false);
   this.wait_secs = 0;
   setNum_workersIsSet(false);
   this.num_workers = 0;
   this.num_executors = null;
 }
    public void read(org.apache.thrift.protocol.TProtocol iprot, RebalanceOptions 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: // WAIT_SECS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.wait_secs = iprot.readI32();
              struct.setWait_secsIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // NUM_WORKERS
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.num_workers = iprot.readI32();
              struct.setNum_workersIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // NUM_EXECUTORS
            if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
              {
                org.apache.thrift.protocol.TMap _map316 = iprot.readMapBegin();
                struct.num_executors = new HashMap<String, Integer>(2 * _map316.size);
                for (int _i317 = 0; _i317 < _map316.size; ++_i317) {
                  String _key318; // required
                  int _val319; // required
                  _key318 = iprot.readString();
                  _val319 = iprot.readI32();
                  struct.num_executors.put(_key318, _val319);
                }
                iprot.readMapEnd();
              }
              struct.setNum_executorsIsSet(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();
    }
 public RebalanceOptions setWait_secs(int wait_secs) {
   this.wait_secs = wait_secs;
   setWait_secsIsSet(true);
   return this;
 }