All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.iotdb.cluster.rpc.thrift.StartUpStatus Maven / Gradle / Ivy

There is a newer version: 0.13.4
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.14.1)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.apache.iotdb.cluster.rpc.thrift;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.14.1)", date = "2022-07-31")
public class StartUpStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
  private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("StartUpStatus");

  private static final org.apache.thrift.protocol.TField PARTITION_INTERVAL_FIELD_DESC = new org.apache.thrift.protocol.TField("partitionInterval", org.apache.thrift.protocol.TType.I64, (short)1);
  private static final org.apache.thrift.protocol.TField HASH_SALT_FIELD_DESC = new org.apache.thrift.protocol.TField("hashSalt", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField REPLICATION_NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("replicationNumber", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField SEED_NODE_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("seedNodeList", org.apache.thrift.protocol.TType.LIST, (short)4);
  private static final org.apache.thrift.protocol.TField CLUSTER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("clusterName", org.apache.thrift.protocol.TType.STRING, (short)5);
  private static final org.apache.thrift.protocol.TField MULTI_RAFT_FACTOR_FIELD_DESC = new org.apache.thrift.protocol.TField("multiRaftFactor", org.apache.thrift.protocol.TType.I32, (short)6);

  private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new StartUpStatusStandardSchemeFactory();
  private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new StartUpStatusTupleSchemeFactory();

  public long partitionInterval; // required
  public int hashSalt; // required
  public int replicationNumber; // required
  public @org.apache.thrift.annotation.Nullable java.util.List seedNodeList; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String clusterName; // required
  public int multiRaftFactor; // required

  /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
  public enum _Fields implements org.apache.thrift.TFieldIdEnum {
    PARTITION_INTERVAL((short)1, "partitionInterval"),
    HASH_SALT((short)2, "hashSalt"),
    REPLICATION_NUMBER((short)3, "replicationNumber"),
    SEED_NODE_LIST((short)4, "seedNodeList"),
    CLUSTER_NAME((short)5, "clusterName"),
    MULTI_RAFT_FACTOR((short)6, "multiRaftFactor");

    private static final java.util.Map byName = new java.util.HashMap();

    static {
      for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) {
        byName.put(field.getFieldName(), field);
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByThriftId(int fieldId) {
      switch(fieldId) {
        case 1: // PARTITION_INTERVAL
          return PARTITION_INTERVAL;
        case 2: // HASH_SALT
          return HASH_SALT;
        case 3: // REPLICATION_NUMBER
          return REPLICATION_NUMBER;
        case 4: // SEED_NODE_LIST
          return SEED_NODE_LIST;
        case 5: // CLUSTER_NAME
          return CLUSTER_NAME;
        case 6: // MULTI_RAFT_FACTOR
          return MULTI_RAFT_FACTOR;
        default:
          return null;
      }
    }

    /**
     * Find the _Fields constant that matches fieldId, throwing an exception
     * if it is not found.
     */
    public static _Fields findByThriftIdOrThrow(int fieldId) {
      _Fields fields = findByThriftId(fieldId);
      if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!");
      return fields;
    }

    /**
     * Find the _Fields constant that matches name, or null if its not found.
     */
    @org.apache.thrift.annotation.Nullable
    public static _Fields findByName(java.lang.String name) {
      return byName.get(name);
    }

    private final short _thriftId;
    private final java.lang.String _fieldName;

    _Fields(short thriftId, java.lang.String fieldName) {
      _thriftId = thriftId;
      _fieldName = fieldName;
    }

    public short getThriftFieldId() {
      return _thriftId;
    }

    public java.lang.String getFieldName() {
      return _fieldName;
    }
  }

  // isset id assignments
  private static final int __PARTITIONINTERVAL_ISSET_ID = 0;
  private static final int __HASHSALT_ISSET_ID = 1;
  private static final int __REPLICATIONNUMBER_ISSET_ID = 2;
  private static final int __MULTIRAFTFACTOR_ISSET_ID = 3;
  private byte __isset_bitfield = 0;
  public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
  static {
    java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
    tmpMap.put(_Fields.PARTITION_INTERVAL, new org.apache.thrift.meta_data.FieldMetaData("partitionInterval", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64        , "long")));
    tmpMap.put(_Fields.HASH_SALT, new org.apache.thrift.meta_data.FieldMetaData("hashSalt", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.REPLICATION_NUMBER, new org.apache.thrift.meta_data.FieldMetaData("replicationNumber", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.SEED_NODE_LIST, new org.apache.thrift.meta_data.FieldMetaData("seedNodeList", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, 
            new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Node.class))));
    tmpMap.put(_Fields.CLUSTER_NAME, new org.apache.thrift.meta_data.FieldMetaData("clusterName", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.MULTI_RAFT_FACTOR, new org.apache.thrift.meta_data.FieldMetaData("multiRaftFactor", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(StartUpStatus.class, metaDataMap);
  }

  public StartUpStatus() {
  }

  public StartUpStatus(
    long partitionInterval,
    int hashSalt,
    int replicationNumber,
    java.util.List seedNodeList,
    java.lang.String clusterName,
    int multiRaftFactor)
  {
    this();
    this.partitionInterval = partitionInterval;
    setPartitionIntervalIsSet(true);
    this.hashSalt = hashSalt;
    setHashSaltIsSet(true);
    this.replicationNumber = replicationNumber;
    setReplicationNumberIsSet(true);
    this.seedNodeList = seedNodeList;
    this.clusterName = clusterName;
    this.multiRaftFactor = multiRaftFactor;
    setMultiRaftFactorIsSet(true);
  }

  /**
   * Performs a deep copy on other.
   */
  public StartUpStatus(StartUpStatus other) {
    __isset_bitfield = other.__isset_bitfield;
    this.partitionInterval = other.partitionInterval;
    this.hashSalt = other.hashSalt;
    this.replicationNumber = other.replicationNumber;
    if (other.isSetSeedNodeList()) {
      java.util.List __this__seedNodeList = new java.util.ArrayList(other.seedNodeList.size());
      for (Node other_element : other.seedNodeList) {
        __this__seedNodeList.add(new Node(other_element));
      }
      this.seedNodeList = __this__seedNodeList;
    }
    if (other.isSetClusterName()) {
      this.clusterName = other.clusterName;
    }
    this.multiRaftFactor = other.multiRaftFactor;
  }

  public StartUpStatus deepCopy() {
    return new StartUpStatus(this);
  }

  @Override
  public void clear() {
    setPartitionIntervalIsSet(false);
    this.partitionInterval = 0;
    setHashSaltIsSet(false);
    this.hashSalt = 0;
    setReplicationNumberIsSet(false);
    this.replicationNumber = 0;
    this.seedNodeList = null;
    this.clusterName = null;
    setMultiRaftFactorIsSet(false);
    this.multiRaftFactor = 0;
  }

  public long getPartitionInterval() {
    return this.partitionInterval;
  }

  public StartUpStatus setPartitionInterval(long partitionInterval) {
    this.partitionInterval = partitionInterval;
    setPartitionIntervalIsSet(true);
    return this;
  }

  public void unsetPartitionInterval() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID);
  }

  /** Returns true if field partitionInterval is set (has been assigned a value) and false otherwise */
  public boolean isSetPartitionInterval() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID);
  }

  public void setPartitionIntervalIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PARTITIONINTERVAL_ISSET_ID, value);
  }

  public int getHashSalt() {
    return this.hashSalt;
  }

  public StartUpStatus setHashSalt(int hashSalt) {
    this.hashSalt = hashSalt;
    setHashSaltIsSet(true);
    return this;
  }

  public void unsetHashSalt() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASHSALT_ISSET_ID);
  }

  /** Returns true if field hashSalt is set (has been assigned a value) and false otherwise */
  public boolean isSetHashSalt() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASHSALT_ISSET_ID);
  }

  public void setHashSaltIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASHSALT_ISSET_ID, value);
  }

  public int getReplicationNumber() {
    return this.replicationNumber;
  }

  public StartUpStatus setReplicationNumber(int replicationNumber) {
    this.replicationNumber = replicationNumber;
    setReplicationNumberIsSet(true);
    return this;
  }

  public void unsetReplicationNumber() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __REPLICATIONNUMBER_ISSET_ID);
  }

  /** Returns true if field replicationNumber is set (has been assigned a value) and false otherwise */
  public boolean isSetReplicationNumber() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __REPLICATIONNUMBER_ISSET_ID);
  }

  public void setReplicationNumberIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __REPLICATIONNUMBER_ISSET_ID, value);
  }

  public int getSeedNodeListSize() {
    return (this.seedNodeList == null) ? 0 : this.seedNodeList.size();
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.Iterator getSeedNodeListIterator() {
    return (this.seedNodeList == null) ? null : this.seedNodeList.iterator();
  }

  public void addToSeedNodeList(Node elem) {
    if (this.seedNodeList == null) {
      this.seedNodeList = new java.util.ArrayList();
    }
    this.seedNodeList.add(elem);
  }

  @org.apache.thrift.annotation.Nullable
  public java.util.List getSeedNodeList() {
    return this.seedNodeList;
  }

  public StartUpStatus setSeedNodeList(@org.apache.thrift.annotation.Nullable java.util.List seedNodeList) {
    this.seedNodeList = seedNodeList;
    return this;
  }

  public void unsetSeedNodeList() {
    this.seedNodeList = null;
  }

  /** Returns true if field seedNodeList is set (has been assigned a value) and false otherwise */
  public boolean isSetSeedNodeList() {
    return this.seedNodeList != null;
  }

  public void setSeedNodeListIsSet(boolean value) {
    if (!value) {
      this.seedNodeList = null;
    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.String getClusterName() {
    return this.clusterName;
  }

  public StartUpStatus setClusterName(@org.apache.thrift.annotation.Nullable java.lang.String clusterName) {
    this.clusterName = clusterName;
    return this;
  }

  public void unsetClusterName() {
    this.clusterName = null;
  }

  /** Returns true if field clusterName is set (has been assigned a value) and false otherwise */
  public boolean isSetClusterName() {
    return this.clusterName != null;
  }

  public void setClusterNameIsSet(boolean value) {
    if (!value) {
      this.clusterName = null;
    }
  }

  public int getMultiRaftFactor() {
    return this.multiRaftFactor;
  }

  public StartUpStatus setMultiRaftFactor(int multiRaftFactor) {
    this.multiRaftFactor = multiRaftFactor;
    setMultiRaftFactorIsSet(true);
    return this;
  }

  public void unsetMultiRaftFactor() {
    __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MULTIRAFTFACTOR_ISSET_ID);
  }

  /** Returns true if field multiRaftFactor is set (has been assigned a value) and false otherwise */
  public boolean isSetMultiRaftFactor() {
    return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MULTIRAFTFACTOR_ISSET_ID);
  }

  public void setMultiRaftFactorIsSet(boolean value) {
    __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MULTIRAFTFACTOR_ISSET_ID, value);
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case PARTITION_INTERVAL:
      if (value == null) {
        unsetPartitionInterval();
      } else {
        setPartitionInterval((java.lang.Long)value);
      }
      break;

    case HASH_SALT:
      if (value == null) {
        unsetHashSalt();
      } else {
        setHashSalt((java.lang.Integer)value);
      }
      break;

    case REPLICATION_NUMBER:
      if (value == null) {
        unsetReplicationNumber();
      } else {
        setReplicationNumber((java.lang.Integer)value);
      }
      break;

    case SEED_NODE_LIST:
      if (value == null) {
        unsetSeedNodeList();
      } else {
        setSeedNodeList((java.util.List)value);
      }
      break;

    case CLUSTER_NAME:
      if (value == null) {
        unsetClusterName();
      } else {
        setClusterName((java.lang.String)value);
      }
      break;

    case MULTI_RAFT_FACTOR:
      if (value == null) {
        unsetMultiRaftFactor();
      } else {
        setMultiRaftFactor((java.lang.Integer)value);
      }
      break;

    }
  }

  @org.apache.thrift.annotation.Nullable
  public java.lang.Object getFieldValue(_Fields field) {
    switch (field) {
    case PARTITION_INTERVAL:
      return getPartitionInterval();

    case HASH_SALT:
      return getHashSalt();

    case REPLICATION_NUMBER:
      return getReplicationNumber();

    case SEED_NODE_LIST:
      return getSeedNodeList();

    case CLUSTER_NAME:
      return getClusterName();

    case MULTI_RAFT_FACTOR:
      return getMultiRaftFactor();

    }
    throw new java.lang.IllegalStateException();
  }

  /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
  public boolean isSet(_Fields field) {
    if (field == null) {
      throw new java.lang.IllegalArgumentException();
    }

    switch (field) {
    case PARTITION_INTERVAL:
      return isSetPartitionInterval();
    case HASH_SALT:
      return isSetHashSalt();
    case REPLICATION_NUMBER:
      return isSetReplicationNumber();
    case SEED_NODE_LIST:
      return isSetSeedNodeList();
    case CLUSTER_NAME:
      return isSetClusterName();
    case MULTI_RAFT_FACTOR:
      return isSetMultiRaftFactor();
    }
    throw new java.lang.IllegalStateException();
  }

  @Override
  public boolean equals(java.lang.Object that) {
    if (that instanceof StartUpStatus)
      return this.equals((StartUpStatus)that);
    return false;
  }

  public boolean equals(StartUpStatus that) {
    if (that == null)
      return false;
    if (this == that)
      return true;

    boolean this_present_partitionInterval = true;
    boolean that_present_partitionInterval = true;
    if (this_present_partitionInterval || that_present_partitionInterval) {
      if (!(this_present_partitionInterval && that_present_partitionInterval))
        return false;
      if (this.partitionInterval != that.partitionInterval)
        return false;
    }

    boolean this_present_hashSalt = true;
    boolean that_present_hashSalt = true;
    if (this_present_hashSalt || that_present_hashSalt) {
      if (!(this_present_hashSalt && that_present_hashSalt))
        return false;
      if (this.hashSalt != that.hashSalt)
        return false;
    }

    boolean this_present_replicationNumber = true;
    boolean that_present_replicationNumber = true;
    if (this_present_replicationNumber || that_present_replicationNumber) {
      if (!(this_present_replicationNumber && that_present_replicationNumber))
        return false;
      if (this.replicationNumber != that.replicationNumber)
        return false;
    }

    boolean this_present_seedNodeList = true && this.isSetSeedNodeList();
    boolean that_present_seedNodeList = true && that.isSetSeedNodeList();
    if (this_present_seedNodeList || that_present_seedNodeList) {
      if (!(this_present_seedNodeList && that_present_seedNodeList))
        return false;
      if (!this.seedNodeList.equals(that.seedNodeList))
        return false;
    }

    boolean this_present_clusterName = true && this.isSetClusterName();
    boolean that_present_clusterName = true && that.isSetClusterName();
    if (this_present_clusterName || that_present_clusterName) {
      if (!(this_present_clusterName && that_present_clusterName))
        return false;
      if (!this.clusterName.equals(that.clusterName))
        return false;
    }

    boolean this_present_multiRaftFactor = true;
    boolean that_present_multiRaftFactor = true;
    if (this_present_multiRaftFactor || that_present_multiRaftFactor) {
      if (!(this_present_multiRaftFactor && that_present_multiRaftFactor))
        return false;
      if (this.multiRaftFactor != that.multiRaftFactor)
        return false;
    }

    return true;
  }

  @Override
  public int hashCode() {
    int hashCode = 1;

    hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(partitionInterval);

    hashCode = hashCode * 8191 + hashSalt;

    hashCode = hashCode * 8191 + replicationNumber;

    hashCode = hashCode * 8191 + ((isSetSeedNodeList()) ? 131071 : 524287);
    if (isSetSeedNodeList())
      hashCode = hashCode * 8191 + seedNodeList.hashCode();

    hashCode = hashCode * 8191 + ((isSetClusterName()) ? 131071 : 524287);
    if (isSetClusterName())
      hashCode = hashCode * 8191 + clusterName.hashCode();

    hashCode = hashCode * 8191 + multiRaftFactor;

    return hashCode;
  }

  @Override
  public int compareTo(StartUpStatus other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetPartitionInterval(), other.isSetPartitionInterval());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPartitionInterval()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.partitionInterval, other.partitionInterval);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetHashSalt(), other.isSetHashSalt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHashSalt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hashSalt, other.hashSalt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetReplicationNumber(), other.isSetReplicationNumber());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetReplicationNumber()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.replicationNumber, other.replicationNumber);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetSeedNodeList(), other.isSetSeedNodeList());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSeedNodeList()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.seedNodeList, other.seedNodeList);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetClusterName(), other.isSetClusterName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClusterName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clusterName, other.clusterName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMultiRaftFactor(), other.isSetMultiRaftFactor());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMultiRaftFactor()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.multiRaftFactor, other.multiRaftFactor);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }

  @org.apache.thrift.annotation.Nullable
  public _Fields fieldForId(int fieldId) {
    return _Fields.findByThriftId(fieldId);
  }

  public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    scheme(iprot).read(iprot, this);
  }

  public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
    scheme(oprot).write(oprot, this);
  }

  @Override
  public java.lang.String toString() {
    java.lang.StringBuilder sb = new java.lang.StringBuilder("StartUpStatus(");
    boolean first = true;

    sb.append("partitionInterval:");
    sb.append(this.partitionInterval);
    first = false;
    if (!first) sb.append(", ");
    sb.append("hashSalt:");
    sb.append(this.hashSalt);
    first = false;
    if (!first) sb.append(", ");
    sb.append("replicationNumber:");
    sb.append(this.replicationNumber);
    first = false;
    if (!first) sb.append(", ");
    sb.append("seedNodeList:");
    if (this.seedNodeList == null) {
      sb.append("null");
    } else {
      sb.append(this.seedNodeList);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("clusterName:");
    if (this.clusterName == null) {
      sb.append("null");
    } else {
      sb.append(this.clusterName);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("multiRaftFactor:");
    sb.append(this.multiRaftFactor);
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    // alas, we cannot check 'partitionInterval' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'hashSalt' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'replicationNumber' because it's a primitive and you chose the non-beans generator.
    if (seedNodeList == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'seedNodeList' was not present! Struct: " + toString());
    }
    if (clusterName == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clusterName' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'multiRaftFactor' because it's a primitive and you chose the non-beans generator.
    // check for sub-struct validity
  }

  private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
    try {
      write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException {
    try {
      // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.
      __isset_bitfield = 0;
      read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
    } catch (org.apache.thrift.TException te) {
      throw new java.io.IOException(te);
    }
  }

  private static class StartUpStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public StartUpStatusStandardScheme getScheme() {
      return new StartUpStatusStandardScheme();
    }
  }

  private static class StartUpStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme {

    public void read(org.apache.thrift.protocol.TProtocol iprot, StartUpStatus 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: // PARTITION_INTERVAL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.partitionInterval = iprot.readI64();
              struct.setPartitionIntervalIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // HASH_SALT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.hashSalt = iprot.readI32();
              struct.setHashSaltIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // REPLICATION_NUMBER
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.replicationNumber = iprot.readI32();
              struct.setReplicationNumberIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // SEED_NODE_LIST
            if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
              {
                org.apache.thrift.protocol.TList _list8 = iprot.readListBegin();
                struct.seedNodeList = new java.util.ArrayList(_list8.size);
                @org.apache.thrift.annotation.Nullable Node _elem9;
                for (int _i10 = 0; _i10 < _list8.size; ++_i10)
                {
                  _elem9 = new Node();
                  _elem9.read(iprot);
                  struct.seedNodeList.add(_elem9);
                }
                iprot.readListEnd();
              }
              struct.setSeedNodeListIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CLUSTER_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clusterName = iprot.readString();
              struct.setClusterNameIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // MULTI_RAFT_FACTOR
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.multiRaftFactor = iprot.readI32();
              struct.setMultiRaftFactorIsSet(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.isSetPartitionInterval()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'partitionInterval' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetHashSalt()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'hashSalt' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetReplicationNumber()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'replicationNumber' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetMultiRaftFactor()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'multiRaftFactor' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot, StartUpStatus struct) throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(PARTITION_INTERVAL_FIELD_DESC);
      oprot.writeI64(struct.partitionInterval);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(HASH_SALT_FIELD_DESC);
      oprot.writeI32(struct.hashSalt);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(REPLICATION_NUMBER_FIELD_DESC);
      oprot.writeI32(struct.replicationNumber);
      oprot.writeFieldEnd();
      if (struct.seedNodeList != null) {
        oprot.writeFieldBegin(SEED_NODE_LIST_FIELD_DESC);
        {
          oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.seedNodeList.size()));
          for (Node _iter11 : struct.seedNodeList)
          {
            _iter11.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.clusterName != null) {
        oprot.writeFieldBegin(CLUSTER_NAME_FIELD_DESC);
        oprot.writeString(struct.clusterName);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(MULTI_RAFT_FACTOR_FIELD_DESC);
      oprot.writeI32(struct.multiRaftFactor);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

  private static class StartUpStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public StartUpStatusTupleScheme getScheme() {
      return new StartUpStatusTupleScheme();
    }
  }

  private static class StartUpStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme {

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, StartUpStatus struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeI64(struct.partitionInterval);
      oprot.writeI32(struct.hashSalt);
      oprot.writeI32(struct.replicationNumber);
      {
        oprot.writeI32(struct.seedNodeList.size());
        for (Node _iter12 : struct.seedNodeList)
        {
          _iter12.write(oprot);
        }
      }
      oprot.writeString(struct.clusterName);
      oprot.writeI32(struct.multiRaftFactor);
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, StartUpStatus struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.partitionInterval = iprot.readI64();
      struct.setPartitionIntervalIsSet(true);
      struct.hashSalt = iprot.readI32();
      struct.setHashSaltIsSet(true);
      struct.replicationNumber = iprot.readI32();
      struct.setReplicationNumberIsSet(true);
      {
        org.apache.thrift.protocol.TList _list13 = iprot.readListBegin(org.apache.thrift.protocol.TType.STRUCT);
        struct.seedNodeList = new java.util.ArrayList(_list13.size);
        @org.apache.thrift.annotation.Nullable Node _elem14;
        for (int _i15 = 0; _i15 < _list13.size; ++_i15)
        {
          _elem14 = new Node();
          _elem14.read(iprot);
          struct.seedNodeList.add(_elem14);
        }
      }
      struct.setSeedNodeListIsSet(true);
      struct.clusterName = iprot.readString();
      struct.setClusterNameIsSet(true);
      struct.multiRaftFactor = iprot.readI32();
      struct.setMultiRaftFactorIsSet(true);
    }
  }

  private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
    return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy