Java Code Examples for org.apache.hadoop.hbase.client.Scan.setScanMetricsEnabled()

The following are Jave code examples for showing how to use setScanMetricsEnabled() of the org.apache.hadoop.hbase.client.Scan class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: ditb   File: TableRecordReaderImpl.java   Source Code and License Vote up 6 votes
/**
 * Restart from survivable exceptions by creating a new scanner.
 *
 * @param firstRow  The first row to start at.
 * @throws IOException When restarting fails.
 */
public void restart(byte[] firstRow) throws IOException {
  currentScan = new Scan(scan);
  currentScan.setStartRow(firstRow);
  currentScan.setScanMetricsEnabled(true);
  if (this.scanner != null) {
    if (logScannerActivity) {
      LOG.info("Closing the previously opened scanner object.");
    }
    this.scanner.close();
  }
  this.scanner = this.htable.getScanner(currentScan);
  if (logScannerActivity) {
    LOG.info("Current scan=" + currentScan.toString());
    timestamp = System.currentTimeMillis();
    rowcount = 0;
  }
}
 
Example 2
Project: ditb   File: ScanPerformanceEvaluation.java   Source Code and License Vote up 5 votes
private Scan getScan() {
  Scan scan = new Scan(); // default scan settings
  scan.setCacheBlocks(false);
  scan.setMaxVersions(1);
  scan.setScanMetricsEnabled(true);
  if (caching != null) {
    scan.setCaching(Integer.parseInt(caching));
  }

  return scan;
}