/** * Returns true if this region is known to be NSRE'd and shouldn't be used. * @see #handleNSRE */ private static boolean knownToBeNSREd(final RegionInfo region) { return region.table() == EMPTY_ARRAY; }
/** * Constructor. * @param region The region we were looking up * (if known, can be {@code null} if not known). * @param msg A message describing as precisely as possible what's wrong * with the META table. */ BrokenMetaException(final RegionInfo region, final String msg) { super("Your .META. table seems broken for " + (region == null ? "(unknown table)" : region) + ". " + msg); this.table = region.table(); }
/** * Constructor. * @param lock The lock we wanna release. * @param region The region corresponding to {@code lock.region()}. */ ReleaseRequest(final RowLock lock, final RegionInfo region) { super(region.table(), // This isn't actually the key we locked, but it doesn't matter // as this information is useless for this RPC, we simply supply // a key to the parent constructor to make it happy. region.stopKey()); this.lock = lock; }
/** * Returns the client currently known to hose the given region, or NULL. */ private RegionClient clientFor(final RegionInfo region) { if (region == null) { return null; } else if (region == META_REGION || Bytes.equals(region.table(), ROOT) || Bytes.equals(region.table(), HBASE98_ROOT)) { // HBase 0.95+: META_REGION (which is 0.95 specific) is our root. // HBase 0.94 and earlier: if we're looking for -ROOT-, stop here. // Split meta uses hbase:root for the table name. return rootregion; } return region2client.get(region); }
/** * Package private ctor as we want read-only information for the caller to play * with. We'll make copies of all of the arrays so that the user can't modify * anything used by AsyncHBase internally. * @param region_info The region info to pull the table, name and stop key from * @param start_key The start key of the region * @param host The region server hosting the region. May be null if the region * isn't hosted anywhere. * @param port The port for the region server. May be zero if the region isn't * hosted anywhere. */ RegionLocation(RegionInfo region_info, byte[] start_key, String host, int port) { table = Arrays.copyOf(region_info.table(), region_info.table().length); region_name = Arrays.copyOf(region_info.name(), region_info.name().length); // may be an empty array but shouldn't be null stop_key = Arrays.copyOf(region_info.stopKey(), region_info.stopKey().length); this.start_key = Arrays.copyOf(start_key, start_key.length); this.host = host; this.port = port; }
final byte[] table = region.table(); final byte[] stop_key = region.stopKey();
RegionClient client = null; if (region != null) { client = (Bytes.equals(region.table(), split_meta ? HBASE98_ROOT_REGION : ROOT) ? rootregion : region2client.get(region));