当前位置: 首页>>代码示例>>Java>>正文


Java Get.setCacheBlocks方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.Get.setCacheBlocks方法的典型用法代码示例。如果您正苦于以下问题:Java Get.setCacheBlocks方法的具体用法?Java Get.setCacheBlocks怎么用?Java Get.setCacheBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.client.Get的用法示例。


在下文中一共展示了Get.setCacheBlocks方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import org.apache.hadoop.hbase.client.Get; //导入方法依赖的package包/类
public void run() {
  try {
    Get get = new Get(rowkey);
    get.setFilter(ftlist);
    get.setCacheBlocks(false);

    if (resultColumns != null && resultColumns.length != 0) {
      for (byte[] column : resultColumns) {
        byte[][] tmp = KeyValue.parseColumn(column);

        if (tmp.length == 1) {
          get.addFamily(tmp[0]);
        } else {
          get.addColumn(tmp[0], tmp[1]);
        }
      }
    }

    rsnew = table.get(get);
    table.close();
  } catch (Exception e) {
    rsnew = null;
    exception = e;
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:26,代码来源:IndexResultScanner.java

示例2: Get

import org.apache.hadoop.hbase.client.Get; //导入方法依赖的package包/类
/**
 * 获取单张表的单条记录
 * 
 * @throws IOException
 */
public static byte[] Get(String key, String TableName, String ColumnFamily, String ColumnName) throws IOException {
	Get get_cell = new Get(Bytes.toBytes(key));
	get_cell.addColumn(Bytes.toBytes(ColumnFamily), Bytes.toBytes(ColumnName));
	get_cell.setMaxVersions(1);
	get_cell.setCacheBlocks(false);
	Result result = hbase_table.get(get_cell);
	return result.value();
}
 
开发者ID:ItGql,项目名称:SparkIsax,代码行数:14,代码来源:HBaseUtils.java

示例3: RowResultGenerator

import org.apache.hadoop.hbase.client.Get; //导入方法依赖的package包/类
public RowResultGenerator(final String tableName, final RowSpec rowspec,
    final Filter filter, final boolean cacheBlocks)
    throws IllegalArgumentException, IOException {
  Table table = RESTServlet.getInstance().getTable(tableName);
  try {
    Get get = new Get(rowspec.getRow());
    if (rowspec.hasColumns()) {
      for (byte[] col: rowspec.getColumns()) {
        byte[][] split = KeyValue.parseColumn(col);
        if (split.length == 1) {
          get.addFamily(split[0]);
        } else if (split.length == 2) {
          get.addColumn(split[0], split[1]);
        } else {
          throw new IllegalArgumentException("Invalid column specifier.");
        }
      }
    }
    get.setTimeRange(rowspec.getStartTime(), rowspec.getEndTime());
    get.setMaxVersions(rowspec.getMaxVersions());
    if (filter != null) {
      get.setFilter(filter);
    }
    get.setCacheBlocks(cacheBlocks);
    Result result = table.get(get);
    if (result != null && !result.isEmpty()) {
      valuesI = result.listCells().iterator();
    }
  } catch (DoNotRetryIOException | NeedUnmanagedConnectionException e) {
    // Warn here because Stargate will return 404 in the case if multiple
    // column families were specified but one did not exist -- currently
    // HBase will fail the whole Get.
    // Specifying multiple columns in a URI should be uncommon usage but
    // help to avoid confusion by leaving a record of what happened here in
    // the log.
    LOG.warn(StringUtils.stringifyException(e));
  } finally {
    table.close();
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:41,代码来源:RowResultGenerator.java

示例4: processGet

import org.apache.hadoop.hbase.client.Get; //导入方法依赖的package包/类
protected Result processGet(Table table, Get get) throws IOException {
  get.setCacheBlocks(false);
  return table.get(get);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:5,代码来源:PerfScanBase.java


注:本文中的org.apache.hadoop.hbase.client.Get.setCacheBlocks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。