org.apache.hadoop.hbase.client.Get.getMaxVersions()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中org.apache.hadoop.hbase.client.Get.getMaxVersions()方法的一些代码示例,展示了Get.getMaxVersions()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Get.getMaxVersions()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Get
类名称:Get
方法名:getMaxVersions

Get.getMaxVersions介绍

[英]Method for retrieving the get's maximum number of version
[中]用于检索get的最大版本数的方法

代码示例

代码示例来源:origin: apache/hbase

@Override
public Result[] get(List<Get> gets) throws IOException {
 byte[][] rows = new byte[gets.size()][];
 int maxVersions = 1;
 int count = 0;
 for(Get g:gets) {
  if ( count == 0 ) {
   maxVersions = g.getMaxVersions();
  } else if (g.getMaxVersions() != maxVersions) {
   LOG.warn("MaxVersions on Gets do not match, using the first in the list ("+maxVersions+")");
  }
  if (g.getFilter() != null) {
   LOG.warn("filters not supported on gets");
  }
  rows[count] = g.getRow();
  count ++;
 }
 String spec = buildMultiRowSpec(rows, maxVersions);
 return getResults(spec);
}

代码示例来源:origin: apache/hbase

List<Cell> result = ctx.getEnvironment().getRegion().get(get, false);
if (result.size() < get.getMaxVersions()) {
if (result.size() > get.getMaxVersions()) {
 throw new RuntimeException("Unexpected size: " + result.size()
   + ". Results more than the max versions obtained.");
Cell getCell = result.get(get.getMaxVersions() - 1);
PrivateCellUtil.setTimestamp(cell, getCell.getTimestamp());

代码示例来源:origin: apache/kylin

List<KeyValue> kvs = new ArrayList<KeyValue>();
if (!get.hasFamilies()) {
  kvs = toKeyValue(row, data.get(row), get.getMaxVersions());
} else {
  for (byte[] family : get.getFamilyMap().keySet()) {

代码示例来源: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.maxVersions = get.getMaxVersions();
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();

代码示例来源:origin: apache/hbase

this.filter = get.getFilter();
this.cacheBlocks = get.getCacheBlocks();
this.maxVersions = get.getMaxVersions();
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();

代码示例来源:origin: apache/hbase

tTimeRange.setMaxStamp(in.getTimeRange().getMax()).setMinStamp(in.getTimeRange().getMin());
out.setTimeRange(tTimeRange);
out.setMaxVersions(in.getMaxVersions());

代码示例来源: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

builder.setRow(ByteStringer.wrap(get.getRow()));
builder.setCacheBlocks(get.getCacheBlocks());
builder.setMaxVersions(get.getMaxVersions());
if (get.getFilter() != null) {
 builder.setFilter(ProtobufUtil.toFilter(get.getFilter()));

代码示例来源:origin: apache/hbase

builder.setRow(UnsafeByteOperations.unsafeWrap(get.getRow()));
builder.setCacheBlocks(get.getCacheBlocks());
builder.setMaxVersions(get.getMaxVersions());
if (get.getFilter() != null) {
 builder.setFilter(ProtobufUtil.toFilter(get.getFilter()));

代码示例来源:origin: apache/hbase

assertEquals(get.getLoadColumnFamiliesOnDemandValue(), scan.getLoadColumnFamiliesOnDemandValue());
assertEquals(get.getMaxResultsPerColumnFamily(), scan.getMaxResultsPerColumnFamily());
assertEquals(get.getMaxVersions(), scan.getMaxVersions());
assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily());
assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin());

代码示例来源:origin: apache/hbase

assertEquals(get.getMaxVersions(), copyGet.getMaxVersions());
assertEquals(get.getMaxResultsPerColumnFamily(), copyGet.getMaxResultsPerColumnFamily());
assertEquals(get.getRowOffsetPerColumnFamily(), copyGet.getRowOffsetPerColumnFamily());

代码示例来源:origin: org.apache.hbase/hbase-client

this.maxVersions = get.getMaxVersions();
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();

代码示例来源:origin: org.apache.hbase/hbase-client

this.filter = get.getFilter();
this.cacheBlocks = get.getCacheBlocks();
this.maxVersions = get.getMaxVersions();
this.storeLimit = get.getMaxResultsPerColumnFamily();
this.storeOffset = get.getRowOffsetPerColumnFamily();

代码示例来源:origin: apache/metron

List<KeyValue> kvs = new ArrayList<KeyValue>();
if (!get.hasFamilies()) {
 kvs = toKeyValue(row, data.get(row), get.getMaxVersions());
} else {
 for (byte[] family : get.getFamilyMap().keySet()){

代码示例来源:origin: org.apache.hbase/hbase-client

builder.setRow(ByteStringer.wrap(get.getRow()));
builder.setCacheBlocks(get.getCacheBlocks());
builder.setMaxVersions(get.getMaxVersions());
if (get.getFilter() != null) {
 builder.setFilter(ProtobufUtil.toFilter(get.getFilter()));

代码示例来源:origin: org.apache.hbase/hbase-client

builder.setRow(UnsafeByteOperations.unsafeWrap(get.getRow()));
builder.setCacheBlocks(get.getCacheBlocks());
builder.setMaxVersions(get.getMaxVersions());
if (get.getFilter() != null) {
 builder.setFilter(ProtobufUtil.toFilter(get.getFilter()));

代码示例来源:origin: org.apache.hbase/hbase-client

assertEquals(get.getLoadColumnFamiliesOnDemandValue(), scan.getLoadColumnFamiliesOnDemandValue());
assertEquals(get.getMaxResultsPerColumnFamily(), scan.getMaxResultsPerColumnFamily());
assertEquals(get.getMaxVersions(), scan.getMaxVersions());
assertEquals(get.getRowOffsetPerColumnFamily(), scan.getRowOffsetPerColumnFamily());
assertEquals(get.getTimeRange().getMin(), scan.getTimeRange().getMin());

代码示例来源:origin: org.apache.hbase/hbase-client

assertEquals(get.getMaxVersions(), copyGet.getMaxVersions());
assertEquals(get.getMaxResultsPerColumnFamily(), copyGet.getMaxResultsPerColumnFamily());
assertEquals(get.getRowOffsetPerColumnFamily(), copyGet.getRowOffsetPerColumnFamily());

代码示例来源: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());
}

相关文章