@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); } }
@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; }