Java 类org.apache.hadoop.hbase.client.AbstractClientScanner 实例源码

项目:cloud-bigtable-client    文件:BigtableResultScannerAdapter.java   
public ResultScanner adapt(
    final com.google.cloud.bigtable.grpc.ResultScanner<Row> bigtableResultScanner) {
  return new AbstractClientScanner() {
    @Override
    public Result next() throws IOException {
      Row row = bigtableResultScanner.next();
      if (row == null) {
        // Null signals EOF.
        return null;
      }
      return rowAdapter.adaptResponse(row);
    }

    @Override
    public void close() {
      try {
        bigtableResultScanner.close();
      } catch (IOException ioe) {
        throw Throwables.propagate(ioe);
      }
    }
  };
}