本文整理了Java中org.apache.hadoop.hbase.client.Get.setIsolationLevel()
方法的一些代码示例,展示了Get.setIsolationLevel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get.setIsolationLevel()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Get
类名称:Get
方法名:setIsolationLevel
暂无
代码示例来源:origin: apache/hbase
/**
* Do a specific Get on passed <code>columnFamily</code> and column qualifiers.
* @param mutation Mutation we are doing this Get for.
* @param store Which column family on row (TODO: Go all Gets in one go)
* @param coordinates Cells from <code>mutation</code> used as coordinates applied to Get.
* @return Return list of Cells found.
*/
private List<Cell> get(Mutation mutation, HStore store, List<Cell> coordinates,
IsolationLevel isolation, TimeRange tr) throws IOException {
// Sort the cells so that they match the order that they appear in the Get results. Otherwise,
// we won't be able to find the existing values if the cells are not specified in order by the
// client since cells are in an array list.
// TODO: I don't get why we are sorting. St.Ack 20150107
sort(coordinates, store.getComparator());
Get get = new Get(mutation.getRow());
if (isolation != null) {
get.setIsolationLevel(isolation);
}
for (Cell cell: coordinates) {
get.addColumn(store.getColumnFamilyDescriptor().getName(), CellUtil.cloneQualifier(cell));
}
// Increments carry time range. If an Increment instance, put it on the Get.
if (tr != null) {
get.setTimeRange(tr.getMin(), tr.getMax());
}
return get(get, false);
}
代码示例来源:origin: apache/hbase
private void assertICV(byte [] row,
byte [] familiy,
byte[] qualifier,
long amount,
boolean fast) throws IOException {
// run a get and see?
Get get = new Get(row);
if (fast) get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.addColumn(familiy, qualifier);
Result result = region.get(get);
assertEquals(1, result.size());
Cell kv = result.rawCells()[0];
long r = Bytes.toLong(CellUtil.cloneValue(kv));
assertEquals(amount, r);
}
代码示例来源:origin: apache/hbase
.setFilter(new FilterList())
.setId("get")
.setIsolationLevel(IsolationLevel.READ_COMMITTED)
.setLoadColumnFamiliesOnDemand(false)
.setMaxResultsPerColumnFamily(1000)
代码示例来源:origin: apache/hbase
get.setConsistency(Consistency.TIMELINE);
get.setReplicaId(2);
get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.setCheckExistenceOnly(true);
get.setTimeRange(3, 4);
代码示例来源:origin: org.apache.hbase/hbase-client
.setFilter(new FilterList())
.setId("get")
.setIsolationLevel(IsolationLevel.READ_COMMITTED)
.setLoadColumnFamiliesOnDemand(false)
.setMaxResultsPerColumnFamily(1000)
代码示例来源:origin: org.apache.hbase/hbase-client
get.setConsistency(Consistency.TIMELINE);
get.setReplicaId(2);
get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.setCheckExistenceOnly(true);
get.setTimeRange(3, 4);
代码示例来源:origin: harbby/presto-connectors
/**
* Do a specific Get on passed <code>columnFamily</code> and column qualifiers
* from <code>incrementCoordinates</code> only.
* @param increment
* @param columnFamily
* @param incrementCoordinates
* @return Return the Cells to Increment
* @throws IOException
*/
private List<Cell> getIncrementCurrentValue(final Increment increment, byte [] columnFamily,
final List<Cell> increments, final IsolationLevel isolation)
throws IOException {
Get get = new Get(increment.getRow());
if (isolation != null) get.setIsolationLevel(isolation);
for (Cell cell: increments) {
get.addColumn(columnFamily, CellUtil.cloneQualifier(cell));
}
TimeRange tr = increment.getTimeRange();
if (tr != null) {
get.setTimeRange(tr.getMin(), tr.getMax());
}
return get(get, false);
}
代码示例来源:origin: org.apache.hbase/hbase-server
private void assertICV(byte [] row,
byte [] familiy,
byte[] qualifier,
long amount,
boolean fast) throws IOException {
// run a get and see?
Get get = new Get(row);
if (fast) get.setIsolationLevel(IsolationLevel.READ_UNCOMMITTED);
get.addColumn(familiy, qualifier);
Result result = region.get(get);
assertEquals(1, result.size());
Cell kv = result.rawCells()[0];
long r = Bytes.toLong(CellUtil.cloneValue(kv));
assertEquals(amount, r);
}
内容来源于网络,如有侵权,请联系作者删除!