@Override public void updateRegionFavoredNodesMapping(String encodedRegionName, List<org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName> favoredNodes) { InetSocketAddress[] addr = new InetSocketAddress[favoredNodes.size()]; // Refer to the comment on the declaration of regionFavoredNodesMap on why // it is a map of region name to InetSocketAddress[] for (int i = 0; i < favoredNodes.size(); i++) { addr[i] = InetSocketAddress.createUnresolved(favoredNodes.get(i).getHostName(), favoredNodes.get(i).getPort()); } regionFavoredNodesMap.put(encodedRegionName, addr); }
@Override public CompletableFuture<ServerName> getMasterAddress() { return getAndConvert(znodePaths.masterAddressZNode, ZKAsyncRegistry::getMasterProto) .thenApply(proto -> { if (proto == null) { return null; } HBaseProtos.ServerName snProto = proto.getMaster(); return ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode()); }); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasHostName()) { hash = (37 * hash) + HOST_NAME_FIELD_NUMBER; hash = (53 * hash) + getHostName().hashCode(); } if (hasPort()) { hash = (37 * hash) + PORT_FIELD_NUMBER; hash = (53 * hash) + getPort(); } if (hasStartCode()) { hash = (37 * hash) + START_CODE_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getStartCode()); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName sn = rss.getMaster(); return ServerName.valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode()); } catch (/*InvalidProtocolBufferException*/IOException e) {
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName other = (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName) obj; boolean result = true; result = result && (hasHostName() == other.hasHostName()); if (hasHostName()) { result = result && getHostName() .equals(other.getHostName()); } result = result && (hasPort() == other.hasPort()); if (hasPort()) { result = result && (getPort() == other.getPort()); } result = result && (hasStartCode() == other.hasStartCode()); if (hasStartCode()) { result = result && (getStartCode() == other.getStartCode()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasHostName()) { hash = (37 * hash) + HOST_NAME_FIELD_NUMBER; hash = (53 * hash) + getHostName().hashCode(); } if (hasPort()) { hash = (37 * hash) + PORT_FIELD_NUMBER; hash = (53 * hash) + getPort(); } if (hasStartCode()) { hash = (37 * hash) + START_CODE_FIELD_NUMBER; hash = (53 * hash) + org.apache.hbase.thirdparty.com.google.protobuf.Internal.hashLong( getStartCode()); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * Convert a protocol buffer ServerName to a ServerName * * @param proto the protocol buffer ServerName to convert * @return the converted ServerName */ public static ServerName toServerName(final HBaseProtos.ServerName proto) { if (proto == null) return null; String hostName = proto.getHostName(); long startCode = -1; int port = -1; if (proto.hasPort()) { port = proto.getPort(); } if (proto.hasStartCode()) { startCode = proto.getStartCode(); } return ServerName.valueOf(hostName, port, startCode); }
/** * <code>required string host_name = 1;</code> */ public Builder clearHostName() { bitField0_ = (bitField0_ & ~0x00000001); hostName_ = getDefaultInstance().getHostName(); onChanged(); return this; } /**
private Pair<RegionState.State, ServerName> getStateAndServerName( ZooKeeperProtos.MetaRegionServer proto) { RegionState.State state; if (proto.hasState()) { state = RegionState.State.convert(proto.getState()); } else { state = RegionState.State.OPEN; } HBaseProtos.ServerName snProto = proto.getServer(); return Pair.newPair(state, ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode())); }
@Override public CompletableFuture<ServerName> getMasterAddress() { return getAndConvert(znodePaths.masterAddressZNode, ZKAsyncRegistry::getMasterProto) .thenApply(proto -> { if (proto == null) { return null; } HBaseProtos.ServerName snProto = proto.getMaster(); return ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode()); }); }
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName sn = rss.getMaster(); return ServerName.valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode()); } catch (/*InvalidProtocolBufferException*/IOException e) {
/** * Convert a protocol buffer ServerName to a ServerName * * @param proto the protocol buffer ServerName to convert * @return the converted ServerName */ public static ServerName toServerName(final HBaseProtos.ServerName proto) { if (proto == null) return null; String hostName = proto.getHostName(); long startCode = -1; int port = -1; if (proto.hasPort()) { port = proto.getPort(); } if (proto.hasStartCode()) { startCode = proto.getStartCode(); } return ServerName.valueOf(hostName, port, startCode); }
@Override public CompletableFuture<ServerName> getMasterAddress() { return getAndConvert(znodePaths.masterAddressZNode, ZKAsyncRegistry::getMasterProto) .thenApply(proto -> { if (proto == null) { return null; } HBaseProtos.ServerName snProto = proto.getMaster(); return ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode()); }); }
private Pair<RegionState.State, ServerName> getStateAndServerName( ZooKeeperProtos.MetaRegionServer proto) { RegionState.State state; if (proto.hasState()) { state = RegionState.State.convert(proto.getState()); } else { state = RegionState.State.OPEN; } HBaseProtos.ServerName snProto = proto.getServer(); return Pair.newPair(state, ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode())); }
sn.getHostName(), sn.getPort(), sn.getStartCode()); } catch (InvalidProtocolBufferException e) { throw new DeserializationException("Unable to parse meta region location");
org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName sn = rss.getMaster(); return ServerName.valueOf(sn.getHostName(), sn.getPort(), sn.getStartCode()); } catch (/*InvalidProtocolBufferException*/IOException e) {
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName)) { return super.equals(obj); } org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName other = (org.apache.hadoop.hbase.shaded.protobuf.generated.HBaseProtos.ServerName) obj; boolean result = true; result = result && (hasHostName() == other.hasHostName()); if (hasHostName()) { result = result && getHostName() .equals(other.getHostName()); } result = result && (hasPort() == other.hasPort()); if (hasPort()) { result = result && (getPort() == other.getPort()); } result = result && (hasStartCode() == other.hasStartCode()); if (hasStartCode()) { result = result && (getStartCode() == other.getStartCode()); } result = result && unknownFields.equals(other.unknownFields); return result; }
/** * Convert a protocol buffer ServerName to a ServerName * * @param proto the protocol buffer ServerName to convert * @return the converted ServerName */ public static ServerName toServerName(final HBaseProtos.ServerName proto) { if (proto == null) return null; String hostName = proto.getHostName(); long startCode = -1; int port = -1; if (proto.hasPort()) { port = proto.getPort(); } if (proto.hasStartCode()) { startCode = proto.getStartCode(); } return ServerName.valueOf(hostName, port, startCode); }
/** * <code>required string host_name = 1;</code> */ public Builder clearHostName() { bitField0_ = (bitField0_ & ~0x00000001); hostName_ = getDefaultInstance().getHostName(); onChanged(); return this; } /**
private Pair<RegionState.State, ServerName> getStateAndServerName( ZooKeeperProtos.MetaRegionServer proto) { RegionState.State state; if (proto.hasState()) { state = RegionState.State.convert(proto.getState()); } else { state = RegionState.State.OPEN; } HBaseProtos.ServerName snProto = proto.getServer(); return Pair.newPair(state, ServerName.valueOf(snProto.getHostName(), snProto.getPort(), snProto.getStartCode())); }