Exemplo n.º 1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, WorkerNetAddress struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetHost()) {
     optionals.set(0);
   }
   if (struct.isSetRpcPort()) {
     optionals.set(1);
   }
   if (struct.isSetDataPort()) {
     optionals.set(2);
   }
   if (struct.isSetWebPort()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetHost()) {
     oprot.writeString(struct.host);
   }
   if (struct.isSetRpcPort()) {
     oprot.writeI32(struct.rpcPort);
   }
   if (struct.isSetDataPort()) {
     oprot.writeI32(struct.dataPort);
   }
   if (struct.isSetWebPort()) {
     oprot.writeI32(struct.webPort);
   }
 }
Exemplo n.º 2
0
  public boolean equals(WorkerNetAddress that) {
    if (that == null) return false;

    boolean this_present_host = true && this.isSetHost();
    boolean that_present_host = true && that.isSetHost();
    if (this_present_host || that_present_host) {
      if (!(this_present_host && that_present_host)) return false;
      if (!this.host.equals(that.host)) return false;
    }

    boolean this_present_rpcPort = true;
    boolean that_present_rpcPort = true;
    if (this_present_rpcPort || that_present_rpcPort) {
      if (!(this_present_rpcPort && that_present_rpcPort)) return false;
      if (this.rpcPort != that.rpcPort) 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_webPort = true;
    boolean that_present_webPort = true;
    if (this_present_webPort || that_present_webPort) {
      if (!(this_present_webPort && that_present_webPort)) return false;
      if (this.webPort != that.webPort) return false;
    }

    return true;
  }
Exemplo n.º 3
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, WorkerNetAddress 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: // HOST
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.host = iprot.readString();
              struct.setHostIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // RPC_PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.rpcPort = iprot.readI32();
              struct.setRpcPortIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // 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 4: // WEB_PORT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.webPort = iprot.readI32();
              struct.setWebPortIsSet(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();
    }
Exemplo n.º 4
0
 /** Performs a deep copy on <i>other</i>. */
 public WorkerNetAddress(WorkerNetAddress other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetHost()) {
     this.host = other.host;
   }
   this.rpcPort = other.rpcPort;
   this.dataPort = other.dataPort;
   this.webPort = other.webPort;
 }
Exemplo n.º 5
0
  @Override
  public int compareTo(WorkerNetAddress other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetHost()).compareTo(other.isSetHost());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetHost()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetRpcPort()).compareTo(other.isSetRpcPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetRpcPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rpcPort, other.rpcPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetDataPort()).compareTo(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 = Boolean.valueOf(isSetWebPort()).compareTo(other.isSetWebPort());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWebPort()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.webPort, other.webPort);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemplo n.º 6
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, WorkerNetAddress struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(4);
   if (incoming.get(0)) {
     struct.host = iprot.readString();
     struct.setHostIsSet(true);
   }
   if (incoming.get(1)) {
     struct.rpcPort = iprot.readI32();
     struct.setRpcPortIsSet(true);
   }
   if (incoming.get(2)) {
     struct.dataPort = iprot.readI32();
     struct.setDataPortIsSet(true);
   }
   if (incoming.get(3)) {
     struct.webPort = iprot.readI32();
     struct.setWebPortIsSet(true);
   }
 }
Exemplo n.º 7
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, WorkerNetAddress struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.host != null) {
        oprot.writeFieldBegin(HOST_FIELD_DESC);
        oprot.writeString(struct.host);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(RPC_PORT_FIELD_DESC);
      oprot.writeI32(struct.rpcPort);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(DATA_PORT_FIELD_DESC);
      oprot.writeI32(struct.dataPort);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(WEB_PORT_FIELD_DESC);
      oprot.writeI32(struct.webPort);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }