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

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

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

Get.readAllVersions介绍

[英]Get all available versions.
[中]获取所有可用版本。

代码示例

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

/**
 * Get all available versions.
 * @return this for invocation chaining
 * @deprecated It is easy to misunderstand with column family's max versions, so use
 *             {@link #readAllVersions()} instead.
 */
@Deprecated
public Get setMaxVersions() {
 return readAllVersions();
}

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

public static long[] getReplicationBarrier(Connection conn, byte[] regionName)
  throws IOException {
 try (Table table = getMetaHTable(conn)) {
  Result result = table.get(new Get(regionName)
   .addColumn(HConstants.REPLICATION_BARRIER_FAMILY, HConstants.SEQNUM_QUALIFIER)
   .readAllVersions());
  return getReplicationBarriers(result);
 }
}

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

/**
 * Setup
 * @throws Exception
 */
@Before
public void setUp() throws Exception {
 qualifiers.add(qf1);
 qualifiers.add(qf3);
 qualifiers.add(qf5);
 Iterator<byte[]> iter = qualifiers.iterator();
 while(iter.hasNext()){
  byte [] next = iter.next();
  expected.add(new KeyValue(row, family, next, 1, value));
  get.addColumn(family, next);
  get.readAllVersions();
 }
}

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

@Test
public void testDeleteWithFailed() throws Exception {
 final TableName tableName = TableName.valueOf(name.getMethodName());
 byte [][] FAMILIES = makeNAscii(FAMILY, 3);
 byte [][] VALUES = makeN(VALUE, 5);
 long [] ts = {1000, 2000, 3000, 4000, 5000};
 Table ht = TEST_UTIL.createTable(tableName, FAMILIES, 3);
 Put put = new Put(ROW);
 put.addColumn(FAMILIES[0], QUALIFIER, ts[0], VALUES[0]);
 ht.put(put);
 // delete wrong family
 Delete delete = new Delete(ROW);
 delete.addFamily(FAMILIES[1], ts[0]);
 ht.delete(delete);
 Get get = new Get(ROW);
 get.addFamily(FAMILIES[0]);
 get.readAllVersions();
 Result result = ht.get(get);
 assertTrue(Bytes.equals(result.getValue(FAMILIES[0], QUALIFIER), VALUES[0]));
}

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

@Test
public void testWithColumnCountGetFilter() throws Exception {
 Get get = new Get(ONE);
 get.readAllVersions();
 get.addFamily(CF);
 get.setFilter(new ColumnCountGetFilter(2));

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

@Test
public void testDeleteWithNoVisibilitiesForPutsAndDeletes() throws Exception {
 TableName tableName = createTable(5);
 Put p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual, value);
 Table table = TEST_UTIL.getConnection().getTable(tableName);
 table.put(p);
 p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual1, value);
 table.put(p);
 p = new Put(Bytes.toBytes("row2"));
 p.addColumn(fam, qual, value);
 table.put(p);
 p = new Put(Bytes.toBytes("row2"));
 p.addColumn(fam, qual1, value);
 table.put(p);
 Delete d = new Delete(Bytes.toBytes("row1"));
 table.delete(d);
 Get g = new Get(Bytes.toBytes("row1"));
 g.readAllVersions();
 g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
 Result result = table.get(g);
 assertEquals(0, result.rawCells().length);
 p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual, value);
 table.put(p);
 result = table.get(g);
 assertEquals(1, result.rawCells().length);
}

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

/**
 * Get all available versions.
 * @return this for invocation chaining
 * @deprecated It is easy to misunderstand with column family's max versions, so use
 *             {@link #readAllVersions()} instead.
 */
@Deprecated
public Get setMaxVersions() {
 return readAllVersions();
}

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

g.readAllVersions();
Result r = t.get(g);
g.readAllVersions();
r = t.get(g);
g.readAllVersions();
r = t.get(g);

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

get.readAllVersions();
for (int i = 0; i < NB_RETRIES; i++) {
 if (i == NB_RETRIES - 1) {
get.readAllVersions();
for (int i = 0; i < NB_RETRIES; i++) {
 if (i == NB_RETRIES - 1) {

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

g.readAllVersions();
g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
Result result = table.get(g);
g.readAllVersions();
g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
result = table.get(g);

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

public static long[] getReplicationBarrier(Connection conn, byte[] regionName)
  throws IOException {
 try (Table table = getMetaHTable(conn)) {
  Result result = table.get(new Get(regionName)
   .addColumn(HConstants.REPLICATION_BARRIER_FAMILY, HConstants.SEQNUM_QUALIFIER)
   .readAllVersions());
  return getReplicationBarriers(result);
 }
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * Get all available versions.
 * @return this for invocation chaining
 * @deprecated It is easy to misunderstand with column family's max versions, so use
 *             {@link #readAllVersions()} instead.
 */
@Deprecated
public Get setMaxVersions() {
 return readAllVersions();
}

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

@Test
public void testWithColumnCountGetFilter() throws Exception {
 Get get = new Get(ONE);
 get.readAllVersions();
 get.addFamily(CF);
 get.setFilter(new ColumnCountGetFilter(2));

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

@Test
public void testDeleteWithFailed() throws Exception {
 final TableName tableName = TableName.valueOf(name.getMethodName());
 byte [][] FAMILIES = makeNAscii(FAMILY, 3);
 byte [][] VALUES = makeN(VALUE, 5);
 long [] ts = {1000, 2000, 3000, 4000, 5000};
 Table ht = TEST_UTIL.createTable(tableName, FAMILIES, 3);
 Put put = new Put(ROW);
 put.addColumn(FAMILIES[0], QUALIFIER, ts[0], VALUES[0]);
 ht.put(put);
 // delete wrong family
 Delete delete = new Delete(ROW);
 delete.addFamily(FAMILIES[1], ts[0]);
 ht.delete(delete);
 Get get = new Get(ROW);
 get.addFamily(FAMILIES[0]);
 get.readAllVersions();
 Result result = ht.get(get);
 assertTrue(Bytes.equals(result.getValue(FAMILIES[0], QUALIFIER), VALUES[0]));
}

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

@Test
public void testDeleteWithNoVisibilitiesForPutsAndDeletes() throws Exception {
 TableName tableName = createTable(5);
 Put p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual, value);
 Table table = TEST_UTIL.getConnection().getTable(tableName);
 table.put(p);
 p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual1, value);
 table.put(p);
 p = new Put(Bytes.toBytes("row2"));
 p.addColumn(fam, qual, value);
 table.put(p);
 p = new Put(Bytes.toBytes("row2"));
 p.addColumn(fam, qual1, value);
 table.put(p);
 Delete d = new Delete(Bytes.toBytes("row1"));
 table.delete(d);
 Get g = new Get(Bytes.toBytes("row1"));
 g.readAllVersions();
 g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
 Result result = table.get(g);
 assertEquals(0, result.rawCells().length);
 p = new Put(Bytes.toBytes("row1"));
 p.addColumn(fam, qual, value);
 table.put(p);
 result = table.get(g);
 assertEquals(1, result.rawCells().length);
}

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

get.readAllVersions();
for (int i = 0; i < NB_RETRIES; i++) {
 if (i == NB_RETRIES - 1) {
get.readAllVersions();
for (int i = 0; i < NB_RETRIES; i++) {
 if (i == NB_RETRIES - 1) {

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

g.readAllVersions();
Result r = t.get(g);
g.readAllVersions();
r = t.get(g);
g.readAllVersions();
r = t.get(g);

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

g.readAllVersions();
g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
Result result = table.get(g);
g.readAllVersions();
g.setAuthorizations(new Authorizations(SECRET, PRIVATE));
result = table.get(g);

相关文章