本文整理汇总了Java中org.apache.hadoop.hbase.client.Scan.setScanMetricsEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Scan.setScanMetricsEnabled方法的具体用法?Java Scan.setScanMetricsEnabled怎么用?Java Scan.setScanMetricsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.hadoop.hbase.client.Scan
的用法示例。
在下文中一共展示了Scan.setScanMetricsEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restart
import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
* 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;
}
}
示例2: getScan
import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
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;
}