byte[] currentKey = HConstants.EMPTY_START_ROW; do { HRegionLocation regionLocation = connection.getRegionLocation(tableName, currentKey, reload); locations.add(regionLocation); currentKey = regionLocation.getRegionInfo().getEndKey();
/** * Finds the region on which the given row is being served. * @param row Row to find. * @param reload whether or not to reload information or just use cached * information * @return Location of the row. * @throws IOException if a remote or network exception occurs */ public HRegionLocation getRegionLocation(final byte [] row, boolean reload) throws IOException { return connection.getRegionLocation(tableName, row, reload); }
/** * Finds the region on which the given row is being served. * @param row Row to find. * @return Location of the row. * @throws IOException if a remote or network exception occurs * @deprecated use {@link #getRegionLocation(byte [], boolean)} instead */ public HRegionLocation getRegionLocation(final byte [] row) throws IOException { return connection.getRegionLocation(tableName, row, false); }
/** * Find region location hosting passed row using cached info * @param row Row to find. * @return The location of the given row. * @throws IOException if a remote or network exception occurs */ public HRegionLocation getRegionLocation(final String row) throws IOException { return connection.getRegionLocation(tableName, Bytes.toBytes(row), false); }
/** * Connect to the server hosting region with row from tablename. * @param reload Set this to true if connection should re-find the region * @throws IOException e */ public void connect(final boolean reload) throws IOException { this.location = connection.getRegionLocation(tableName, row, reload); this.server = connection.getHRegionConnection(location.getHostname(), location.getPort()); }
if(loc != null) return loc; loc = hconn.getRegionLocation(table, row, true); if (loc == null) { throw new IOException("Can't locate location for row:" + Bytes.toString(row)
loc = hconn.getRegionLocation(tableName, row, true);