Java 类org.apache.hadoop.hbase.regionserver.WrongRegionException 实例源码

项目:LCIndex-HBase-0.94.16    文件:MultiRowMutationEndpoint.java   
@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);
}
项目:IRIndex    文件:MultiRowMutationEndpoint.java   
@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);
}
项目:HBase-Research    文件:MultiRowMutationEndpoint.java   
@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);
}
项目:hbase-0.94.8-qod    文件:MultiRowMutationEndpoint.java   
@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);
}
项目:hbase-0.94.8-qod    文件:MultiRowMutationEndpoint.java   
@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);
}
项目:hindex    文件:MultiRowMutationEndpoint.java   
@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);
}