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; }
@Override public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof THRegionInfo) return this.equals((THRegionInfo)that); return false; }
@org.apache.thrift.annotation.Nullable public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REGION_ID: return getRegionId(); case TABLE_NAME: return getTableName(); case START_KEY: return getStartKey(); case END_KEY: return getEndKey(); case OFFLINE: return isOffline(); case SPLIT: return isSplit(); case REPLICA_ID: return getReplicaId(); } 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 REGION_ID: return isSetRegionId(); case TABLE_NAME: return isSetTableName(); case START_KEY: return isSetStartKey(); case END_KEY: return isSetEndKey(); case OFFLINE: return isSetOffline(); case SPLIT: return isSetSplit(); case REPLICA_ID: return isSetReplicaId(); } throw new java.lang.IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public THRegionInfo(THRegionInfo other) { __isset_bitfield = other.__isset_bitfield; this.regionId = other.regionId; if (other.isSetTableName()) { this.tableName = org.apache.thrift.TBaseHelper.copyBinary(other.tableName); } if (other.isSetStartKey()) { this.startKey = org.apache.thrift.TBaseHelper.copyBinary(other.startKey); } if (other.isSetEndKey()) { this.endKey = org.apache.thrift.TBaseHelper.copyBinary(other.endKey); } this.offline = other.offline; this.split = other.split; this.replicaId = other.replicaId; }
@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); } }
public THRegionInfo deepCopy() { return new THRegionInfo(this); }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(regionId); hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); if (isSetTableName()) hashCode = hashCode * 8191 + tableName.hashCode(); hashCode = hashCode * 8191 + ((isSetStartKey()) ? 131071 : 524287); if (isSetStartKey()) hashCode = hashCode * 8191 + startKey.hashCode(); hashCode = hashCode * 8191 + ((isSetEndKey()) ? 131071 : 524287); if (isSetEndKey()) hashCode = hashCode * 8191 + endKey.hashCode(); hashCode = hashCode * 8191 + ((isSetOffline()) ? 131071 : 524287); if (isSetOffline()) hashCode = hashCode * 8191 + ((offline) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetSplit()) ? 131071 : 524287); if (isSetSplit()) hashCode = hashCode * 8191 + ((split) ? 131071 : 524287); hashCode = hashCode * 8191 + ((isSetReplicaId()) ? 131071 : 524287); if (isSetReplicaId()) hashCode = hashCode * 8191 + replicaId; return hashCode; }
/** * Performs a deep copy on <i>other</i>. */ public THRegionInfo(THRegionInfo other) { __isset_bitfield = other.__isset_bitfield; this.regionId = other.regionId; if (other.isSetTableName()) { this.tableName = org.apache.thrift.TBaseHelper.copyBinary(other.tableName); } if (other.isSetStartKey()) { this.startKey = org.apache.thrift.TBaseHelper.copyBinary(other.startKey); } if (other.isSetEndKey()) { this.endKey = org.apache.thrift.TBaseHelper.copyBinary(other.endKey); } this.offline = other.offline; this.split = other.split; this.replicaId = other.replicaId; }
case 2: // REGION_INFO if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.regionInfo = new THRegionInfo(); struct.regionInfo.read(iprot); struct.setRegionInfoIsSet(true); } else {
/** * 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); } }
boolean this_present_tableName = true && this.isSetTableName(); boolean that_present_tableName = true && that.isSetTableName(); if (this_present_tableName || that_present_tableName) { if (!(this_present_tableName && that_present_tableName)) boolean this_present_startKey = true && this.isSetStartKey(); boolean that_present_startKey = true && that.isSetStartKey(); if (this_present_startKey || that_present_startKey) { if (!(this_present_startKey && that_present_startKey)) boolean this_present_endKey = true && this.isSetEndKey(); boolean that_present_endKey = true && that.isSetEndKey(); if (this_present_endKey || that_present_endKey) { if (!(this_present_endKey && that_present_endKey)) boolean this_present_offline = true && this.isSetOffline(); boolean that_present_offline = true && that.isSetOffline(); if (this_present_offline || that_present_offline) { if (!(this_present_offline && that_present_offline)) boolean this_present_split = true && this.isSetSplit(); boolean that_present_split = true && that.isSetSplit(); if (this_present_split || that_present_split) { if (!(this_present_split && that_present_split)) boolean this_present_replicaId = true && this.isSetReplicaId(); boolean that_present_replicaId = true && that.isSetReplicaId(); if (this_present_replicaId || that_present_replicaId) { if (!(this_present_replicaId && that_present_replicaId))
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 Object getFieldValue(_Fields field) { switch (field) { case REGION_ID: return getRegionId(); case TABLE_NAME: return getTableName(); case START_KEY: return getStartKey(); case END_KEY: return getEndKey(); case OFFLINE: return isOffline(); case SPLIT: return isSplit(); case REPLICA_ID: return getReplicaId(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public THRegionInfo(THRegionInfo other) { __isset_bitfield = other.__isset_bitfield; this.regionId = other.regionId; if (other.isSetTableName()) { this.tableName = org.apache.thrift.TBaseHelper.copyBinary(other.tableName); } if (other.isSetStartKey()) { this.startKey = org.apache.thrift.TBaseHelper.copyBinary(other.startKey); } if (other.isSetEndKey()) { this.endKey = org.apache.thrift.TBaseHelper.copyBinary(other.endKey); } this.offline = other.offline; this.split = other.split; this.replicaId = other.replicaId; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, THRegionLocation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.serverName = new TServerName(); struct.serverName.read(iprot); struct.setServerNameIsSet(true); struct.regionInfo = new THRegionInfo(); struct.regionInfo.read(iprot); struct.setRegionInfoIsSet(true); } }
public boolean equals(THRegionLocation that) { if (that == null) return false; if (this == that) return true; boolean this_present_serverName = true && this.isSetServerName(); boolean that_present_serverName = true && that.isSetServerName(); if (this_present_serverName || that_present_serverName) { if (!(this_present_serverName && that_present_serverName)) return false; if (!this.serverName.equals(that.serverName)) return false; } boolean this_present_regionInfo = true && this.isSetRegionInfo(); boolean that_present_regionInfo = true && that.isSetRegionInfo(); if (this_present_regionInfo || that_present_regionInfo) { if (!(this_present_regionInfo && that_present_regionInfo)) return false; if (!this.regionInfo.equals(that.regionInfo)) return false; } return true; }
public THRegionInfo deepCopy() { return new THRegionInfo(this); }
lastComparison = java.lang.Boolean.valueOf(isSetRegionId()).compareTo(other.isSetRegionId()); if (lastComparison != 0) { return lastComparison; if (isSetRegionId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.regionId, other.regionId); if (lastComparison != 0) { lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; if (isSetTableName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); if (lastComparison != 0) { lastComparison = java.lang.Boolean.valueOf(isSetStartKey()).compareTo(other.isSetStartKey()); if (lastComparison != 0) { return lastComparison; if (isSetStartKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startKey, other.startKey); if (lastComparison != 0) { lastComparison = java.lang.Boolean.valueOf(isSetEndKey()).compareTo(other.isSetEndKey()); if (lastComparison != 0) { return lastComparison; if (isSetEndKey()) {
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; }