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

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

/**
 * 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 Node 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("Node");

  private static final org.apache.thrift.protocol.TField INTERNAL_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("internalIp", org.apache.thrift.protocol.TType.STRING, (short)1);
  private static final org.apache.thrift.protocol.TField META_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("metaPort", org.apache.thrift.protocol.TType.I32, (short)2);
  private static final org.apache.thrift.protocol.TField NODE_IDENTIFIER_FIELD_DESC = new org.apache.thrift.protocol.TField("nodeIdentifier", org.apache.thrift.protocol.TType.I32, (short)3);
  private static final org.apache.thrift.protocol.TField DATA_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("dataPort", org.apache.thrift.protocol.TType.I32, (short)4);
  private static final org.apache.thrift.protocol.TField CLIENT_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("clientPort", org.apache.thrift.protocol.TType.I32, (short)5);
  private static final org.apache.thrift.protocol.TField CLIENT_IP_FIELD_DESC = new org.apache.thrift.protocol.TField("clientIp", org.apache.thrift.protocol.TType.STRING, (short)6);

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

  public @org.apache.thrift.annotation.Nullable java.lang.String internalIp; // required
  public int metaPort; // required
  public int nodeIdentifier; // required
  public int dataPort; // required
  public int clientPort; // required
  public @org.apache.thrift.annotation.Nullable java.lang.String clientIp; // 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 {
    INTERNAL_IP((short)1, "internalIp"),
    META_PORT((short)2, "metaPort"),
    NODE_IDENTIFIER((short)3, "nodeIdentifier"),
    DATA_PORT((short)4, "dataPort"),
    CLIENT_PORT((short)5, "clientPort"),
    CLIENT_IP((short)6, "clientIp");

    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: // INTERNAL_IP
          return INTERNAL_IP;
        case 2: // META_PORT
          return META_PORT;
        case 3: // NODE_IDENTIFIER
          return NODE_IDENTIFIER;
        case 4: // DATA_PORT
          return DATA_PORT;
        case 5: // CLIENT_PORT
          return CLIENT_PORT;
        case 6: // CLIENT_IP
          return CLIENT_IP;
        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 __METAPORT_ISSET_ID = 0;
  private static final int __NODEIDENTIFIER_ISSET_ID = 1;
  private static final int __DATAPORT_ISSET_ID = 2;
  private static final int __CLIENTPORT_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.INTERNAL_IP, new org.apache.thrift.meta_data.FieldMetaData("internalIp", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    tmpMap.put(_Fields.META_PORT, new org.apache.thrift.meta_data.FieldMetaData("metaPort", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.NODE_IDENTIFIER, new org.apache.thrift.meta_data.FieldMetaData("nodeIdentifier", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.DATA_PORT, new org.apache.thrift.meta_data.FieldMetaData("dataPort", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.CLIENT_PORT, new org.apache.thrift.meta_data.FieldMetaData("clientPort", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32        , "int")));
    tmpMap.put(_Fields.CLIENT_IP, new org.apache.thrift.meta_data.FieldMetaData("clientIp", org.apache.thrift.TFieldRequirementType.REQUIRED, 
        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
    metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
    org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Node.class, metaDataMap);
  }

  public Node() {
  }

  public Node(
    java.lang.String internalIp,
    int metaPort,
    int nodeIdentifier,
    int dataPort,
    int clientPort,
    java.lang.String clientIp)
  {
    this();
    this.internalIp = internalIp;
    this.metaPort = metaPort;
    setMetaPortIsSet(true);
    this.nodeIdentifier = nodeIdentifier;
    setNodeIdentifierIsSet(true);
    this.dataPort = dataPort;
    setDataPortIsSet(true);
    this.clientPort = clientPort;
    setClientPortIsSet(true);
    this.clientIp = clientIp;
  }

  /**
   * Performs a deep copy on other.
   */
  public Node(Node other) {
    __isset_bitfield = other.__isset_bitfield;
    if (other.isSetInternalIp()) {
      this.internalIp = other.internalIp;
    }
    this.metaPort = other.metaPort;
    this.nodeIdentifier = other.nodeIdentifier;
    this.dataPort = other.dataPort;
    this.clientPort = other.clientPort;
    if (other.isSetClientIp()) {
      this.clientIp = other.clientIp;
    }
  }

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

  @Override
  public void clear() {
    this.internalIp = null;
    setMetaPortIsSet(false);
    this.metaPort = 0;
    setNodeIdentifierIsSet(false);
    this.nodeIdentifier = 0;
    setDataPortIsSet(false);
    this.dataPort = 0;
    setClientPortIsSet(false);
    this.clientPort = 0;
    this.clientIp = null;
  }

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

  public Node setInternalIp(@org.apache.thrift.annotation.Nullable java.lang.String internalIp) {
    this.internalIp = internalIp;
    return this;
  }

  public void unsetInternalIp() {
    this.internalIp = null;
  }

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

  public void setInternalIpIsSet(boolean value) {
    if (!value) {
      this.internalIp = null;
    }
  }

  public int getMetaPort() {
    return this.metaPort;
  }

  public Node setMetaPort(int metaPort) {
    this.metaPort = metaPort;
    setMetaPortIsSet(true);
    return this;
  }

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

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

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

  public int getNodeIdentifier() {
    return this.nodeIdentifier;
  }

  public Node setNodeIdentifier(int nodeIdentifier) {
    this.nodeIdentifier = nodeIdentifier;
    setNodeIdentifierIsSet(true);
    return this;
  }

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

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

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

  public int getDataPort() {
    return this.dataPort;
  }

  public Node setDataPort(int dataPort) {
    this.dataPort = dataPort;
    setDataPortIsSet(true);
    return this;
  }

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

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

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

  public int getClientPort() {
    return this.clientPort;
  }

  public Node setClientPort(int clientPort) {
    this.clientPort = clientPort;
    setClientPortIsSet(true);
    return this;
  }

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

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

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

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

  public Node setClientIp(@org.apache.thrift.annotation.Nullable java.lang.String clientIp) {
    this.clientIp = clientIp;
    return this;
  }

  public void unsetClientIp() {
    this.clientIp = null;
  }

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

  public void setClientIpIsSet(boolean value) {
    if (!value) {
      this.clientIp = null;
    }
  }

  public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
    switch (field) {
    case INTERNAL_IP:
      if (value == null) {
        unsetInternalIp();
      } else {
        setInternalIp((java.lang.String)value);
      }
      break;

    case META_PORT:
      if (value == null) {
        unsetMetaPort();
      } else {
        setMetaPort((java.lang.Integer)value);
      }
      break;

    case NODE_IDENTIFIER:
      if (value == null) {
        unsetNodeIdentifier();
      } else {
        setNodeIdentifier((java.lang.Integer)value);
      }
      break;

    case DATA_PORT:
      if (value == null) {
        unsetDataPort();
      } else {
        setDataPort((java.lang.Integer)value);
      }
      break;

    case CLIENT_PORT:
      if (value == null) {
        unsetClientPort();
      } else {
        setClientPort((java.lang.Integer)value);
      }
      break;

    case CLIENT_IP:
      if (value == null) {
        unsetClientIp();
      } else {
        setClientIp((java.lang.String)value);
      }
      break;

    }
  }

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

    case META_PORT:
      return getMetaPort();

    case NODE_IDENTIFIER:
      return getNodeIdentifier();

    case DATA_PORT:
      return getDataPort();

    case CLIENT_PORT:
      return getClientPort();

    case CLIENT_IP:
      return getClientIp();

    }
    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 INTERNAL_IP:
      return isSetInternalIp();
    case META_PORT:
      return isSetMetaPort();
    case NODE_IDENTIFIER:
      return isSetNodeIdentifier();
    case DATA_PORT:
      return isSetDataPort();
    case CLIENT_PORT:
      return isSetClientPort();
    case CLIENT_IP:
      return isSetClientIp();
    }
    throw new java.lang.IllegalStateException();
  }

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

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

    boolean this_present_internalIp = true && this.isSetInternalIp();
    boolean that_present_internalIp = true && that.isSetInternalIp();
    if (this_present_internalIp || that_present_internalIp) {
      if (!(this_present_internalIp && that_present_internalIp))
        return false;
      if (!this.internalIp.equals(that.internalIp))
        return false;
    }

    boolean this_present_metaPort = true;
    boolean that_present_metaPort = true;
    if (this_present_metaPort || that_present_metaPort) {
      if (!(this_present_metaPort && that_present_metaPort))
        return false;
      if (this.metaPort != that.metaPort)
        return false;
    }

    boolean this_present_nodeIdentifier = true;
    boolean that_present_nodeIdentifier = true;
    if (this_present_nodeIdentifier || that_present_nodeIdentifier) {
      if (!(this_present_nodeIdentifier && that_present_nodeIdentifier))
        return false;
      if (this.nodeIdentifier != that.nodeIdentifier)
        return false;
    }

    boolean this_present_dataPort = true;
    boolean that_present_dataPort = true;
    if (this_present_dataPort || that_present_dataPort) {
      if (!(this_present_dataPort && that_present_dataPort))
        return false;
      if (this.dataPort != that.dataPort)
        return false;
    }

    boolean this_present_clientPort = true;
    boolean that_present_clientPort = true;
    if (this_present_clientPort || that_present_clientPort) {
      if (!(this_present_clientPort && that_present_clientPort))
        return false;
      if (this.clientPort != that.clientPort)
        return false;
    }

    boolean this_present_clientIp = true && this.isSetClientIp();
    boolean that_present_clientIp = true && that.isSetClientIp();
    if (this_present_clientIp || that_present_clientIp) {
      if (!(this_present_clientIp && that_present_clientIp))
        return false;
      if (!this.clientIp.equals(that.clientIp))
        return false;
    }

    return true;
  }

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

    hashCode = hashCode * 8191 + ((isSetInternalIp()) ? 131071 : 524287);
    if (isSetInternalIp())
      hashCode = hashCode * 8191 + internalIp.hashCode();

    hashCode = hashCode * 8191 + metaPort;

    hashCode = hashCode * 8191 + nodeIdentifier;

    hashCode = hashCode * 8191 + dataPort;

    hashCode = hashCode * 8191 + clientPort;

    hashCode = hashCode * 8191 + ((isSetClientIp()) ? 131071 : 524287);
    if (isSetClientIp())
      hashCode = hashCode * 8191 + clientIp.hashCode();

    return hashCode;
  }

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

    int lastComparison = 0;

    lastComparison = java.lang.Boolean.compare(isSetInternalIp(), other.isSetInternalIp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetInternalIp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.internalIp, other.internalIp);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetMetaPort(), other.isSetMetaPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMetaPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.metaPort, other.metaPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetNodeIdentifier(), other.isSetNodeIdentifier());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetNodeIdentifier()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nodeIdentifier, other.nodeIdentifier);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetDataPort(), other.isSetDataPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDataPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dataPort, other.dataPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetClientPort(), other.isSetClientPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientPort, other.clientPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = java.lang.Boolean.compare(isSetClientIp(), other.isSetClientIp());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetClientIp()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientIp, other.clientIp);
      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("Node(");
    boolean first = true;

    sb.append("internalIp:");
    if (this.internalIp == null) {
      sb.append("null");
    } else {
      sb.append(this.internalIp);
    }
    first = false;
    if (!first) sb.append(", ");
    sb.append("metaPort:");
    sb.append(this.metaPort);
    first = false;
    if (!first) sb.append(", ");
    sb.append("nodeIdentifier:");
    sb.append(this.nodeIdentifier);
    first = false;
    if (!first) sb.append(", ");
    sb.append("dataPort:");
    sb.append(this.dataPort);
    first = false;
    if (!first) sb.append(", ");
    sb.append("clientPort:");
    sb.append(this.clientPort);
    first = false;
    if (!first) sb.append(", ");
    sb.append("clientIp:");
    if (this.clientIp == null) {
      sb.append("null");
    } else {
      sb.append(this.clientIp);
    }
    first = false;
    sb.append(")");
    return sb.toString();
  }

  public void validate() throws org.apache.thrift.TException {
    // check for required fields
    if (internalIp == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'internalIp' was not present! Struct: " + toString());
    }
    // alas, we cannot check 'metaPort' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'nodeIdentifier' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'dataPort' because it's a primitive and you chose the non-beans generator.
    // alas, we cannot check 'clientPort' because it's a primitive and you chose the non-beans generator.
    if (clientIp == null) {
      throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientIp' was not present! Struct: " + toString());
    }
    // 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 NodeStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
    public NodeStandardScheme getScheme() {
      return new NodeStandardScheme();
    }
  }

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

    public void read(org.apache.thrift.protocol.TProtocol iprot, Node 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: // INTERNAL_IP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.internalIp = iprot.readString();
              struct.setInternalIpIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // META_PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.metaPort = iprot.readI32();
              struct.setMetaPortIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // NODE_IDENTIFIER
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.nodeIdentifier = iprot.readI32();
              struct.setNodeIdentifierIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // DATA_PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.dataPort = iprot.readI32();
              struct.setDataPortIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // CLIENT_PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.clientPort = iprot.readI32();
              struct.setClientPortIsSet(true);
            } else { 
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 6: // CLIENT_IP
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.clientIp = iprot.readString();
              struct.setClientIpIsSet(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.isSetMetaPort()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'metaPort' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetNodeIdentifier()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'nodeIdentifier' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetDataPort()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'dataPort' was not found in serialized data! Struct: " + toString());
      }
      if (!struct.isSetClientPort()) {
        throw new org.apache.thrift.protocol.TProtocolException("Required field 'clientPort' was not found in serialized data! Struct: " + toString());
      }
      struct.validate();
    }

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

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.internalIp != null) {
        oprot.writeFieldBegin(INTERNAL_IP_FIELD_DESC);
        oprot.writeString(struct.internalIp);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(META_PORT_FIELD_DESC);
      oprot.writeI32(struct.metaPort);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(NODE_IDENTIFIER_FIELD_DESC);
      oprot.writeI32(struct.nodeIdentifier);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DATA_PORT_FIELD_DESC);
      oprot.writeI32(struct.dataPort);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(CLIENT_PORT_FIELD_DESC);
      oprot.writeI32(struct.clientPort);
      oprot.writeFieldEnd();
      if (struct.clientIp != null) {
        oprot.writeFieldBegin(CLIENT_IP_FIELD_DESC);
        oprot.writeString(struct.clientIp);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }

  }

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

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

    @Override
    public void write(org.apache.thrift.protocol.TProtocol prot, Node struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      oprot.writeString(struct.internalIp);
      oprot.writeI32(struct.metaPort);
      oprot.writeI32(struct.nodeIdentifier);
      oprot.writeI32(struct.dataPort);
      oprot.writeI32(struct.clientPort);
      oprot.writeString(struct.clientIp);
    }

    @Override
    public void read(org.apache.thrift.protocol.TProtocol prot, Node struct) throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
      struct.internalIp = iprot.readString();
      struct.setInternalIpIsSet(true);
      struct.metaPort = iprot.readI32();
      struct.setMetaPortIsSet(true);
      struct.nodeIdentifier = iprot.readI32();
      struct.setNodeIdentifierIsSet(true);
      struct.dataPort = iprot.readI32();
      struct.setDataPortIsSet(true);
      struct.clientPort = iprot.readI32();
      struct.setClientPortIsSet(true);
      struct.clientIp = iprot.readString();
      struct.setClientIpIsSet(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