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