本文整理汇总了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;
}
}
示例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();
}
示例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();
}
}
示例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);
}