本文整理匯總了Java中org.apache.hadoop.hbase.client.Scan.setSmall方法的典型用法代碼示例。如果您正苦於以下問題:Java Scan.setSmall方法的具體用法?Java Scan.setSmall怎麽用?Java Scan.setSmall使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.hadoop.hbase.client.Scan
的用法示例。
在下文中一共展示了Scan.setSmall方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getRowOrBefore
import org.apache.hadoop.hbase.client.Scan; //導入方法依賴的package包/類
public Result getRowOrBefore(Table table, byte[] row, byte[] family) throws IOException {
long start = System.currentTimeMillis();
Scan scan = new Scan();
scan.addFamily(family);
scan.setReversed(true);
scan.setStartRow(row);
scan.setCacheBlocks(false);
scan.setCaching(1);
scan.setSmall(true);
ResultScanner scanner = table.getScanner(scan);
Result ret = scanner.next();
scanner.close();
prevRowTotalTime += System.currentTimeMillis() - start;
prevRowTotalCount++;
return ret;
}
示例2: insertOneRecord
import org.apache.hadoop.hbase.client.Scan; //導入方法依賴的package包/類
@Override protected void insertOneRecord(AbstractDITBRecord record) throws IOException {
// note, MD-HBase get before update, we summarize the time in get seperately
MDPoint point = record.toMDPoint();
byte[] row = MDUtils.bitwiseZip(point.values, mdAdmin.getDimensions());
// get before row
long startTime = System.currentTimeMillis();
Scan scan = new Scan();
scan.addFamily(MDHBaseAdmin.BUCKET_FAMILY);
scan.setReversed(true);
scan.setStartRow(row);
scan.setCacheBlocks(false);
scan.setCaching(1);
scan.setSmall(true);
ResultScanner scanner = table.getScanner(scan);
Result result = scanner.next();
scanner.close();
gbuTime += System.currentTimeMillis() - startTime;
gbuCount++;
// default scan
if (result == null) {
row = mdAdmin.getBucketSuffixRow(point);
} else {
row = result.getRow();
}
table.incrementColumnValue(row, MDHBaseAdmin.BUCKET_FAMILY,
MDHBaseAdmin.BUCKET_SIZE_QUALIFIER, 1);
}
示例3: processGet
import org.apache.hadoop.hbase.client.Scan; //導入方法依賴的package包/類
@Override protected Result processGet(Table table, Get get) throws IOException {
Scan scan = new Scan();
scan.addFamily(MDHBaseAdmin.BUCKET_FAMILY);
scan.setReversed(true);
scan.setStartRow(get.getRow());
scan.setCacheBlocks(false);
scan.setCaching(1);
scan.setSmall(true);
ResultScanner scanner = table.getScanner(scan);
Result ret = scanner.next();
scanner.close();
return ret;
}
示例4: testSmallScansDoNotAllowPartials
import org.apache.hadoop.hbase.client.Scan; //導入方法依賴的package包/類
public void testSmallScansDoNotAllowPartials(Scan baseScan) throws Exception {
Scan scan = new Scan(baseScan);
scan.setAllowPartialResults(true);
scan.setSmall(true);
scan.setMaxResultSize(1);
ResultScanner scanner = TABLE.getScanner(scan);
Result r = null;
while ((r = scanner.next()) != null) {
assertFalse(r.isPartial());
}
scanner.close();
}