Ejemplo n.º 1
0
  public boolean equals(RebalanceOptions that) {
    if (that == null) return false;

    boolean this_present_wait_secs = true && this.isSetWait_secs();
    boolean that_present_wait_secs = true && that.isSetWait_secs();
    if (this_present_wait_secs || that_present_wait_secs) {
      if (!(this_present_wait_secs && that_present_wait_secs)) return false;
      if (this.wait_secs != that.wait_secs) return false;
    }

    boolean this_present_num_workers = true && this.isSetNum_workers();
    boolean that_present_num_workers = true && that.isSetNum_workers();
    if (this_present_num_workers || that_present_num_workers) {
      if (!(this_present_num_workers && that_present_num_workers)) return false;
      if (this.num_workers != that.num_workers) return false;
    }

    boolean this_present_num_executors = true && this.isSetNum_executors();
    boolean that_present_num_executors = true && that.isSetNum_executors();
    if (this_present_num_executors || that_present_num_executors) {
      if (!(this_present_num_executors && that_present_num_executors)) return false;
      if (!this.num_executors.equals(that.num_executors)) return false;
    }

    return true;
  }
Ejemplo n.º 2
0
 @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);
   }
 }
Ejemplo n.º 3
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, RebalanceOptions struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetWait_secs()) {
     optionals.set(0);
   }
   if (struct.isSetNum_workers()) {
     optionals.set(1);
   }
   if (struct.isSetNum_executors()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetWait_secs()) {
     oprot.writeI32(struct.wait_secs);
   }
   if (struct.isSetNum_workers()) {
     oprot.writeI32(struct.num_workers);
   }
   if (struct.isSetNum_executors()) {
     {
       oprot.writeI32(struct.num_executors.size());
       for (Map.Entry<String, Integer> _iter321 : struct.num_executors.entrySet()) {
         oprot.writeString(_iter321.getKey());
         oprot.writeI32(_iter321.getValue());
       }
     }
   }
 }
Ejemplo n.º 4
0
    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();
    }
Ejemplo n.º 5
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, RebalanceOptions struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetWait_secs()) {
        oprot.writeFieldBegin(WAIT_SECS_FIELD_DESC);
        oprot.writeI32(struct.wait_secs);
        oprot.writeFieldEnd();
      }
      if (struct.isSetNum_workers()) {
        oprot.writeFieldBegin(NUM_WORKERS_FIELD_DESC);
        oprot.writeI32(struct.num_workers);
        oprot.writeFieldEnd();
      }
      if (struct.num_executors != null) {
        if (struct.isSetNum_executors()) {
          oprot.writeFieldBegin(NUM_EXECUTORS_FIELD_DESC);
          {
            oprot.writeMapBegin(
                new org.apache.thrift.protocol.TMap(
                    org.apache.thrift.protocol.TType.STRING,
                    org.apache.thrift.protocol.TType.I32,
                    struct.num_executors.size()));
            for (Map.Entry<String, Integer> _iter320 : struct.num_executors.entrySet()) {
              oprot.writeString(_iter320.getKey());
              oprot.writeI32(_iter320.getValue());
            }
            oprot.writeMapEnd();
          }
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Ejemplo n.º 6
0
  /** Performs a deep copy on <i>other</i>. */
  public RebalanceOptions(RebalanceOptions other) {
    __isset_bitfield = other.__isset_bitfield;
    this.wait_secs = other.wait_secs;
    this.num_workers = other.num_workers;
    if (other.isSetNum_executors()) {
      Map<String, Integer> __this__num_executors = new HashMap<String, Integer>();
      for (Map.Entry<String, Integer> other_element : other.num_executors.entrySet()) {

        String other_element_key = other_element.getKey();
        Integer other_element_value = other_element.getValue();

        String __this__num_executors_copy_key = other_element_key;

        Integer __this__num_executors_copy_value = other_element_value;

        __this__num_executors.put(__this__num_executors_copy_key, __this__num_executors_copy_value);
      }
      this.num_executors = __this__num_executors;
    }
  }
Ejemplo n.º 7
0
  public int compareTo(RebalanceOptions other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    RebalanceOptions typedOther = (RebalanceOptions) other;

    lastComparison = Boolean.valueOf(isSetWait_secs()).compareTo(typedOther.isSetWait_secs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWait_secs()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.wait_secs, typedOther.wait_secs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetNum_workers()).compareTo(typedOther.isSetNum_workers());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum_workers()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.num_workers, typedOther.num_workers);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison =
        Boolean.valueOf(isSetNum_executors()).compareTo(typedOther.isSetNum_executors());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNum_executors()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.num_executors, typedOther.num_executors);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }