/** Make sure this is a valid row for the HRegion */ void checkRow(byte[] row, String op) throws IOException { if (!rowIsInRange(getRegionInfo(), row)) { throw new WrongRegionException("Requested row out of range for " + op + " on HRegion " + this + ", startKey='" + Bytes.toStringBinary(getRegionInfo().getStartKey()) + "', getEndKey()='" + Bytes.toStringBinary(getRegionInfo().getEndKey()) + "', row='" + Bytes.toStringBinary(row) + "'"); } }
for (Mutation m : mutations) { if (!HRegion.rowIsInRange(regionInfo, m.getRow())) { String msg = "Requested row out of range '" + Bytes.toStringBinary(m.getRow()) + "'";
if (HRegion.rowIsInRange(candidate.getRegionInfo(), row)) { region = candidate; break;
if (HRegion.rowIsInRange(candidate.getRegionInfo(), row)) { region = candidate; break;
continue; if (checkRowWithinBoundary && !rowIsInRange(this.getRegionInfo(), cell.getRowArray(), cell.getRowOffset(), cell.getRowLength())) { LOG.warn("Row of " + cell + " is not within region boundary");
public boolean processRow(HRegionInfo info) { if (meta1 == null && HRegion.rowIsInRange(info, region1)) { meta1 = info; } if (region2 != null && meta2 == null && HRegion.rowIsInRange(info, region2)) { meta2 = info; } return meta1 == null || (region2 != null && meta2 == null); }
/** Make sure this is a valid row for the HRegion */ void checkRow(final byte [] row, String op) throws IOException { if(!rowIsInRange(regionInfo, row)) { throw new WrongRegionException("Requested row out of range for " + op + " on HRegion " + this + ", startKey='" + Bytes.toStringBinary(regionInfo.getStartKey()) + "', getEndKey()='" + Bytes.toStringBinary(regionInfo.getEndKey()) + "', row='" + Bytes.toStringBinary(row) + "'"); } }
@Override public void mutateRows(List<Mutation> mutations) throws IOException { // get the coprocessor environment RegionCoprocessorEnvironment env = (RegionCoprocessorEnvironment) getEnvironment(); // set of rows to lock, sorted to avoid deadlocks SortedSet<byte[]> rowsToLock = new TreeSet<byte[]>(Bytes.BYTES_COMPARATOR); HRegionInfo regionInfo = env.getRegion().getRegionInfo(); for (Mutation m : mutations) { // check whether rows are in range for this region if (!HRegion.rowIsInRange(regionInfo, m.getRow())) { String msg = "Requested row out of range '" + Bytes.toStringBinary(m.getRow()) + "'"; if (rowsToLock.isEmpty()) { // if this is the first row, region might have moved, // allow client to retry throw new WrongRegionException(msg); } else { // rows are split between regions, do not retry throw new DoNotRetryIOException(msg); } } rowsToLock.add(m.getRow()); } // call utility method on region env.getRegion().mutateRowsWithLocks(mutations, rowsToLock); } }
for (Mutation m : mutations) { if (!HRegion.rowIsInRange(regionInfo, m.getRow())) { String msg = "Requested row out of range '" + Bytes.toStringBinary(m.getRow()) + "'";
/** Make sure this is a valid row for the HRegion */ void checkRow(final byte [] row, String op) throws IOException { if (!rowIsInRange(getRegionInfo(), row)) { throw new WrongRegionException("Requested row out of range for " + op + " on HRegion " + this + ", startKey='" + Bytes.toStringBinary(getRegionInfo().getStartKey()) + "', getEndKey()='" + Bytes.toStringBinary(getRegionInfo().getEndKey()) + "', row='" + Bytes.toStringBinary(row) + "'"); } }
if (HRegion.rowIsInRange(candidate.getRegionInfo(), row)) { region = candidate; break;
if (HRegion.rowIsInRange(candidate.getRegionInfo(), row)) { region = candidate; break;
continue; if (checkRowWithinBoundary && !rowIsInRange(this.getRegionInfo(), cell.getRowArray(), cell.getRowOffset(), cell.getRowLength())) { LOG.warn("Row of " + cell + " is not within region boundary");