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

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

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

Get.setFilter介绍

[英]Apply the specified server-side filter when performing the Get. Only Filter#filterKeyValue(KeyValue) is called AFTER all tests for ttl, column match, deletes and max versions have been run.
[中]执行Get时应用指定的服务器端筛选器。运行ttl、列匹配、删除和最大版本的所有测试后,只调用Filter#filterKeyValue(KeyValue)。

代码示例

代码示例来源:origin: thinkaurelius/titan

Get g = new Get(key.as(StaticBuffer.ARRAY_FACTORY)).addFamily(columnFamilyBytes).setFilter(getFilter);
try {
  g.setTimeRange(0, Long.MAX_VALUE);

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

public void verifyInvocationResults(Integer[] selectQualifiers,
  Integer[] expectedQualifiers) throws Exception {
 Get get = new Get(ROW_BYTES);
 for (int i = 0; i < selectQualifiers.length; i++) {
  get.addColumn(FAMILY_NAME_BYTES,
    Bytes.toBytes(QUALIFIER_PREFIX + selectQualifiers[i]));
 }
 get.setFilter(new InvocationRecordFilter());
 List<KeyValue> expectedValues = new ArrayList<>();
 for (int i = 0; i < expectedQualifiers.length; i++) {
  expectedValues.add(new KeyValue(ROW_BYTES, FAMILY_NAME_BYTES, Bytes
    .toBytes(QUALIFIER_PREFIX + expectedQualifiers[i]),
    expectedQualifiers[i], Bytes.toBytes(VALUE_PREFIX
      + expectedQualifiers[i])));
 }
 Scan scan = new Scan(get);
 List<Cell> actualValues = new ArrayList<>();
 List<Cell> temp = new ArrayList<>();
 InternalScanner scanner = this.region.getScanner(scan);
 while (scanner.next(temp)) {
  actualValues.addAll(temp);
  temp.clear();
 }
 actualValues.addAll(temp);
 Assert.assertTrue("Actual values " + actualValues
   + " differ from the expected values:" + expectedValues,
   expectedValues.equals(actualValues));
}

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

get.setFilter(new DeleteVersionVisibilityExpressionFilter(visibilityTags,
  VisibilityConstants.SORTED_ORDINAL_SERIALIZATION_FORMAT));
List<Cell> result = ctx.getEnvironment().getRegion().get(get, false);

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

/**
 * Uses the TimestampFilter on a Get to request a specified list of
 * versions for the row/column specified by rowIdx & colIdx.
 *
 */
private  Cell[] getNVersions(Table ht, byte[] cf, int rowIdx,
                 int colIdx, List<Long> versions)
 throws IOException {
 byte row[] = Bytes.toBytes("row:" + rowIdx);
 byte column[] = Bytes.toBytes("column:" + colIdx);
 Filter filter = new TimestampsFilter(versions);
 Get get = new Get(row);
 get.addColumn(cf, column);
 get.setFilter(filter);
 get.setMaxVersions();
 Result result = ht.get(get);
 return result.rawCells();
}

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

this(get.getRow());
this.setFilter(get.getFilter());
this.setReplicaId(get.getReplicaId());
this.setConsistency(get.getConsistency());

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

@Override
 boolean testRow(final int i) throws IOException, InterruptedException {
  Get get = new Get(format(i));
  for (int family = 0; family < opts.families; family++) {
   byte[] familyName = Bytes.toBytes(FAMILY_NAME_BASE + family);
   if (opts.addColumns) {
    for (int column = 0; column < opts.columns; column++) {
     byte [] qualifier = column == 0? COLUMN_ZERO: Bytes.toBytes("" + column);
     get.addColumn(familyName, qualifier);
    }
   } else {
    get.addFamily(familyName);
   }
  }
  if (opts.filterAll) {
   get.setFilter(new FilterAllFilter());
  }
  try {
   updateValueSize(table.get(get).get());
  } catch (ExecutionException e) {
   throw new IOException(e);
  }
  return true;
 }
}

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

get.setFilter(new FilterAllFilter());

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

Filter filter = get.getFilter();
if (filter != null) {
 get.setFilter(new FilterList(filter, visibilityLabelFilter));
} else {
 get.setFilter(visibilityLabelFilter);

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

@Override
 boolean testRow(final int i) throws IOException {
  Get get = new Get(format(i));
  for (int family = 0; family < opts.families; family++) {
   byte[] familyName = Bytes.toBytes(FAMILY_NAME_BASE + family);
   if (opts.addColumns) {
    for (int column = 0; column < opts.columns; column++) {
     byte [] qualifier = column == 0? COLUMN_ZERO: Bytes.toBytes("" + column);
     get.addColumn(familyName, qualifier);
    }
   } else {
    get.addFamily(familyName);
   }
  }
  if (opts.filterAll) {
   get.setFilter(new FilterAllFilter());
  }
  updateValueSize(table.get(get));
  return true;
 }
}

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

g.setFilter(filter);
g.setMaxVersions();
g.addColumn(FAMILY, Bytes.toBytes("column2"));

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

get.setFilter(new FilterAllFilter());

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

get.readAllVersions();
get.addFamily(CF);
get.setFilter(new ColumnCountGetFilter(2));
get.setFilter(new ColumnCountGetFilter(2));
try (CellWithVersionsStoreScanner scanner =
  new CellWithVersionsStoreScanner(new Scan(get), this.scanInfo)) {

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

get.setMaxVersions(rowspec.getMaxVersions());
if (filter != null) {
 get.setFilter(filter);

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

@Test
public void testGetDoesntSeekWithNoHint() throws IOException {
 StoreFileScanner.instrument();
 prepareRegion();
 Get g = new Get(RK_BYTES);
 g.setFilter(new TimestampsFilter(ImmutableList.of(5L)));
 final long initialSeekCount = StoreFileScanner.getSeekCount();
 region.get(g);
 final long finalSeekCount = StoreFileScanner.getSeekCount();
 assertTrue(finalSeekCount >= initialSeekCount );
 assertTrue(finalSeekCount < initialSeekCount + 3);
}

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

@Test
public void testGetSeek() throws IOException {
 StoreFileScanner.instrument();
 prepareRegion();
 Get g = new Get(RK_BYTES);
 final TimestampsFilter timestampsFilter = new TimestampsFilter(ImmutableList.of(5L), true);
 g.setFilter(timestampsFilter);
 final long initialSeekCount = StoreFileScanner.getSeekCount();
 region.get(g);
 final long finalSeekCount = StoreFileScanner.getSeekCount();
 /*
  Make sure there's more than one.
  Aka one seek to get to the row, and one to get to the time.
 */
 assertTrue(finalSeekCount >= initialSeekCount + 3 );
}

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

g.setFilter(new ColumnCountGetFilter(count));
res = region.get(g);
assertEquals(count, res.size());

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

g.setFilter(new FilterList());
Result getResult = table.get(g);
Result scanResult = scanResults.get(0);

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

get.setFilter(new ValueFilter(CompareOp.EQUAL, new SubstringComparator("value")));
res = region.get(get);

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

get.setCacheBlocks(true)
    .setConsistency(Consistency.TIMELINE)
    .setFilter(new FilterList())
    .setId("get")
    .setIsolationLevel(IsolationLevel.READ_COMMITTED)

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

@Test
public void TestGetRowFromGetCopyConstructor() throws Exception {
 Get get = new Get(ROW);
 get.setFilter(null);
 get.setAuthorizations(new Authorizations("foo"));
 get.setACL("u", new Permission(Permission.Action.READ));

相关文章