@Override public void read(org.apache.thrift.protocol.TProtocol prot, THRegionLocation struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.serverName = new TServerName(); struct.serverName.read(iprot); struct.setServerNameIsSet(true); struct.regionInfo = new THRegionInfo(); struct.regionInfo.read(iprot); struct.setRegionInfoIsSet(true); } }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TServerName) return this.equals((TServerName)that); return false; }
@org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case HOST_NAME: return getHostName(); case PORT: return getPort(); case START_CODE: return getStartCode(); } throw new java.lang.IllegalStateException(); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetHostName()) ? 131071 : 524287); if (isSetHostName()) hashCode = hashCode * 8191 + hostName.hashCode(); hashCode = hashCode * 8191 + ((isSetPort()) ? 131071 : 524287); if (isSetPort()) hashCode = hashCode * 8191 + port; hashCode = hashCode * 8191 + ((isSetStartCode()) ? 131071 : 524287); if (isSetStartCode()) hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startCode); return hashCode; }
public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case HOST_NAME: if (value == null) { unsetHostName(); } else { setHostName((java.lang.String)value); } break; case PORT: if (value == null) { unsetPort(); } else { setPort((java.lang.Integer)value); } break; case START_CODE: if (value == null) { unsetStartCode(); } else { setStartCode((java.lang.Long)value); } break; } }
public static THRegionLocation regionLocationFromHBase(HRegionLocation hrl) { HRegionInfo hri = hrl.getRegionInfo(); ServerName serverName = hrl.getServerName(); THRegionInfo thRegionInfo = new THRegionInfo(); THRegionLocation thRegionLocation = new THRegionLocation(); TServerName tServerName = new TServerName(); tServerName.setHostName(serverName.getHostname()); tServerName.setPort(serverName.getPort()); tServerName.setStartCode(serverName.getStartcode()); thRegionInfo.setTableName(hri.getTable().getName()); thRegionInfo.setEndKey(hri.getEndKey()); thRegionInfo.setStartKey(hri.getStartKey()); thRegionInfo.setOffline(hri.isOffline()); thRegionInfo.setSplit(hri.isSplit()); thRegionInfo.setReplicaId(hri.getReplicaId()); thRegionLocation.setRegionInfo(thRegionInfo); thRegionLocation.setServerName(tServerName); return thRegionLocation; }
public void write(org.apache.thrift.protocol.TProtocol oprot, TServerName struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.hostName != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.hostName); oprot.writeFieldEnd(); } if (struct.isSetPort()) { oprot.writeFieldBegin(PORT_FIELD_DESC); oprot.writeI32(struct.port); oprot.writeFieldEnd(); } if (struct.isSetStartCode()) { oprot.writeFieldBegin(START_CODE_FIELD_DESC); oprot.writeI64(struct.startCode); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public java.lang.String toString() { java.lang.StringBuilder sb = new java.lang.StringBuilder("TServerName("); boolean first = true; sb.append("hostName:"); if (this.hostName == null) { sb.append("null"); } else { sb.append(this.hostName); } first = false; if (isSetPort()) { if (!first) sb.append(", "); sb.append("port:"); sb.append(this.port); first = false; } if (isSetStartCode()) { if (!first) sb.append(", "); sb.append("startCode:"); sb.append(this.startCode); first = false; } sb.append(")"); return sb.toString(); }
public TServerName deepCopy() { return new TServerName(this); }
/** * Performs a deep copy on <i>other</i>. */ public TServerName(TServerName other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHostName()) { this.hostName = other.hostName; } this.port = other.port; this.startCode = other.startCode; }
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); } }
/** 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 HOST_NAME: return isSetHostName(); case PORT: return isSetPort(); case START_CODE: return isSetStartCode(); } throw new java.lang.IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case HOST_NAME: if (value == null) { unsetHostName(); } else { setHostName((String)value); } break; case PORT: if (value == null) { unsetPort(); } else { setPort((Integer)value); } break; case START_CODE: if (value == null) { unsetStartCode(); } else { setStartCode((Long)value); } break; } }
public static THRegionLocation regionLocationFromHBase(HRegionLocation hrl) { HRegionInfo hri = hrl.getRegionInfo(); ServerName serverName = hrl.getServerName(); THRegionInfo thRegionInfo = new THRegionInfo(); THRegionLocation thRegionLocation = new THRegionLocation(); TServerName tServerName = new TServerName(); tServerName.setHostName(serverName.getHostname()); tServerName.setPort(serverName.getPort()); tServerName.setStartCode(serverName.getStartcode()); thRegionInfo.setTableName(hri.getTable().getName()); thRegionInfo.setEndKey(hri.getEndKey()); thRegionInfo.setStartKey(hri.getStartKey()); thRegionInfo.setOffline(hri.isOffline()); thRegionInfo.setSplit(hri.isSplit()); thRegionInfo.setReplicaId(hri.getReplicaId()); thRegionLocation.setRegionInfo(thRegionInfo); thRegionLocation.setServerName(tServerName); return thRegionLocation; }
public void write(org.apache.thrift.protocol.TProtocol oprot, TServerName struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.hostName != null) { oprot.writeFieldBegin(HOST_NAME_FIELD_DESC); oprot.writeString(struct.hostName); oprot.writeFieldEnd(); } if (struct.isSetPort()) { oprot.writeFieldBegin(PORT_FIELD_DESC); oprot.writeI32(struct.port); oprot.writeFieldEnd(); } if (struct.isSetStartCode()) { oprot.writeFieldBegin(START_CODE_FIELD_DESC); oprot.writeI64(struct.startCode); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TServerName struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.hostName); java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetPort()) { optionals.set(0); } if (struct.isSetStartCode()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPort()) { oprot.writeI32(struct.port); } if (struct.isSetStartCode()) { oprot.writeI64(struct.startCode); } }
/** * Performs a deep copy on <i>other</i>. */ public THRegionLocation(THRegionLocation other) { if (other.isSetServerName()) { this.serverName = new TServerName(other.serverName); } if (other.isSetRegionInfo()) { this.regionInfo = new THRegionInfo(other.regionInfo); } }
/** * Performs a deep copy on <i>other</i>. */ public TServerName(TServerName other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHostName()) { this.hostName = other.hostName; } this.port = other.port; this.startCode = other.startCode; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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); } }
return true; boolean this_present_hostName = true && this.isSetHostName(); boolean that_present_hostName = true && that.isSetHostName(); if (this_present_hostName || that_present_hostName) { if (!(this_present_hostName && that_present_hostName)) boolean this_present_port = true && this.isSetPort(); boolean that_present_port = true && that.isSetPort(); if (this_present_port || that_present_port) { if (!(this_present_port && that_present_port)) boolean this_present_startCode = true && this.isSetStartCode(); boolean that_present_startCode = true && that.isSetStartCode(); if (this_present_startCode || that_present_startCode) { if (!(this_present_startCode && that_present_startCode))