本文整理了Java中org.apache.hadoop.hbase.client.Get.getTimeRange()
方法的一些代码示例,展示了Get.getTimeRange()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get.getTimeRange()
方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Get
类名称:Get
方法名:getTimeRange
[英]Method for retrieving the get's TimeRange
[中]用于检索get的时间范围的方法
代码示例来源:origin: apache/hbase
@Override
public Result get(Get get) throws IOException {
TimeRange range = get.getTimeRange();
String spec = buildRowSpec(get.getRow(), get.getFamilyMap(),
range.getMin(), range.getMax(), get.getMaxVersions());
if (get.getFilter() != null) {
LOG.warn("filters not supported on gets");
}
Result[] results = getResults(spec);
if (results.length > 0) {
if (results.length > 1) {
LOG.warn("too many results for get (" + results.length + ")");
}
return results[0];
} else {
return new Result();
}
}
代码示例来源:origin: apache/hbase
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();
this.tr = get.getTimeRange();
this.checkExistenceOnly = get.isCheckExistenceOnly();
this.loadColumnFamiliesOnDemand = get.getLoadColumnFamiliesOnDemandValue();
代码示例来源:origin: apache/hbase
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();
this.tr = get.getTimeRange();
this.familyMap = get.getFamilyMap();
this.asyncPrefetch = false;
代码示例来源:origin: apache/hbase
tTimeRange.setMaxStamp(in.getTimeRange().getMax()).setMinStamp(in.getTimeRange().getMin());
out.setTimeRange(tTimeRange);
out.setMaxVersions(in.getMaxVersions());
代码示例来源:origin: apache/hbase
@Override
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
List<Cell> result) throws IOException {
TableName tableName = c.getEnvironment().getRegion().getTableDescriptor().getTableName();
Long ttl = this.ttls.get(tableName);
if (ttl != null) {
get.setTimeRange(EnvironmentEdgeManager.currentTime() - ttl, get.getTimeRange().getMax());
}
Integer version = this.versions.get(tableName);
if (version != null) {
get.readVersions(version);
}
}
代码示例来源:origin: apache/hbase
@Test public void testGet() throws Exception{
byte[] row = "row".getBytes();
byte[] fam = "fam".getBytes();
byte[] qf1 = "qf1".getBytes();
long ts = System.currentTimeMillis();
int maxVersions = 2;
Get get = new Get(row);
get.addColumn(fam, qf1);
get.setTimeRange(ts, ts+1);
get.setMaxVersions(maxVersions);
ClientProtos.Get getProto = ProtobufUtil.toGet(get);
Get desGet = ProtobufUtil.toGet(getProto);
assertTrue(Bytes.equals(get.getRow(), desGet.getRow()));
Set<byte[]> set = null;
Set<byte[]> desSet = null;
for(Map.Entry<byte[], NavigableSet<byte[]>> entry :
get.getFamilyMap().entrySet()){
assertTrue(desGet.getFamilyMap().containsKey(entry.getKey()));
set = entry.getValue();
desSet = desGet.getFamilyMap().get(entry.getKey());
for(byte [] qualifier : set){
assertTrue(desSet.contains(qualifier));
}
}
assertEquals(get.getMaxVersions(), desGet.getMaxVersions());
TimeRange tr = get.getTimeRange();
TimeRange desTr = desGet.getTimeRange();
assertEquals(tr.getMax(), desTr.getMax());
assertEquals(tr.getMin(), desTr.getMin());
}
代码示例来源:origin: apache/hbase
.setTimeRange(toTimeRange(timeRange)).build())
);
builder.setTimeRange(toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
代码示例来源:origin: apache/hbase
.build());
});
builder.setTimeRange(ProtobufUtil.toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
代码示例来源:origin: apache/hbase
assertEquals(get.getMaxVersions(), scan.getMaxVersions());
assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily());
assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin());
assertEquals(get.getTimeRange().getMax(), scan.getTimeRange().getMax());
assertTrue(Bytes.equals(get.getAttribute("att_v0"), scan.getAttribute("att_v0")));
assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMin(),
代码示例来源:origin: apache/hbase
assertTrue(get.getTimeRange().equals(copyGet.getTimeRange()));
assertEquals(get.getMaxVersions(), copyGet.getMaxVersions());
assertEquals(get.getMaxResultsPerColumnFamily(), copyGet.getMaxResultsPerColumnFamily());
代码示例来源:origin: org.apache.hbase/hbase-client
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();
this.tr = get.getTimeRange();
this.checkExistenceOnly = get.isCheckExistenceOnly();
this.loadColumnFamiliesOnDemand = get.getLoadColumnFamiliesOnDemandValue();
代码示例来源:origin: org.apache.hbase/hbase-client
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();
this.tr = get.getTimeRange();
this.familyMap = get.getFamilyMap();
this.asyncPrefetch = false;
代码示例来源:origin: org.apache.hbase/hbase-client
.setTimeRange(toTimeRange(timeRange)).build())
);
builder.setTimeRange(toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
代码示例来源:origin: org.apache.hbase/hbase-client
.build());
});
builder.setTimeRange(ProtobufUtil.toTimeRange(get.getTimeRange()));
Map<String, byte[]> attributes = get.getAttributesMap();
if (!attributes.isEmpty()) {
代码示例来源:origin: com.aliyun.hbase/alihbase-client
public static Get removeColdDataFromGet(Get get,long hotTtl) throws IOException {
long minTimeStamp = System.currentTimeMillis() - hotTtl * 1000;
Get hotGet = new Get(get);
TimeRange tr = hotGet.getTimeRange();
if (tr.getMin() < minTimeStamp) {
hotGet.setTimeRange(minTimeStamp, tr.getMax());
}
return hotGet;
}
代码示例来源:origin: org.apache.hbase/hbase-client
assertEquals(get.getMaxVersions(), scan.getMaxVersions());
assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily());
assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin());
assertEquals(get.getTimeRange().getMax(), scan.getTimeRange().getMax());
assertTrue(Bytes.equals(get.getAttribute("att_v0"), scan.getAttribute("att_v0")));
assertEquals(get.getColumnFamilyTimeRange().get(Bytes.toBytes("cf")).getMin(),
代码示例来源:origin: org.apache.hbase/hbase-client
assertTrue(get.getTimeRange().equals(copyGet.getTimeRange()));
assertEquals(get.getMaxVersions(), copyGet.getMaxVersions());
assertEquals(get.getMaxResultsPerColumnFamily(), copyGet.getMaxResultsPerColumnFamily());
代码示例来源:origin: XiaoMi/themis
@Test
public void testCreateGetOfWriteColumnsIndexingPrewriteTs() throws IOException {
Get get = lockCleaner.createGetOfWriteColumnsIndexingPrewriteTs(COLUMN, prewriteTs);
TestThemisCpUtil.checkReadWithWriteColumns(get.getFamilyMap(), COLUMN);
Assert.assertEquals(prewriteTs, get.getTimeRange().getMin());
Assert.assertEquals(Long.MAX_VALUE, get.getTimeRange().getMax());
Assert.assertEquals(Integer.MAX_VALUE, get.getMaxVersions());
}
代码示例来源:origin: XiaoMi/themis
protected void checkGetsByWriteColumnsKvs(Get get, byte[] row, byte[] family, byte[] qualifier,
long timestamp) throws IOException {
Assert.assertTrue(Bytes.equals(row, get.getRow()));
Assert.assertEquals(1, get.getFamilyMap().size());
Assert.assertEquals(1, get.getFamilyMap().get(family).size());
Assert.assertTrue(get.getFamilyMap().get(family).contains(qualifier));
Assert.assertEquals(timestamp, get.getTimeRange().getMin());
Assert.assertEquals(timestamp + 1, get.getTimeRange().getMax());
}
代码示例来源:origin: org.apache.hbase/hbase-server
@Override
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get,
List<Cell> result) throws IOException {
TableName tableName = c.getEnvironment().getRegion().getTableDescriptor().getTableName();
Long ttl = this.ttls.get(tableName);
if (ttl != null) {
get.setTimeRange(EnvironmentEdgeManager.currentTime() - ttl, get.getTimeRange().getMax());
}
Integer version = this.versions.get(tableName);
if (version != null) {
get.readVersions(version);
}
}
内容来源于网络,如有侵权,请联系作者删除!