當前位置: 首頁>>代碼示例>>Java>>正文


Java Scan.setSmall方法代碼示例

本文整理匯總了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;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:17,代碼來源:MDIndex.java

示例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);
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:28,代碼來源:PerfMD.java

示例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;
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:14,代碼來源:PerfMD.java

示例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();
}
 
開發者ID:fengchen8086,項目名稱:ditb,代碼行數:16,代碼來源:TestPartialResultsFromClientSide.java


注:本文中的org.apache.hadoop.hbase.client.Scan.setSmall方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。