本文整理匯總了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;
}