类org.apache.hadoop.hbase.filter.ColumnPrefixFilter源码实例Demo

下面列出了怎么用org.apache.hadoop.hbase.filter.ColumnPrefixFilter的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hbase   文件: QuotaTableUtil.java
/**
 * Returns a scanner for all namespace snapshot entries of the given namespace
 * @param namespace name of the namespace whose snapshot entries are to be scanned
 */
static Scan createScanForNamespaceSnapshotSizes(String namespace) {
  Scan s = new Scan();
  if (namespace == null || namespace.isEmpty()) {
    // Read all namespaces, just look at the row prefix
    s.setRowPrefixFilter(QUOTA_NAMESPACE_ROW_KEY_PREFIX);
  } else {
    // Fetch the exact row for the table
    byte[] rowkey = getNamespaceRowKey(namespace);
    // Fetch just this one row
    s.withStartRow(rowkey).withStopRow(rowkey, true);
  }

  // Just the usage family and only the snapshot size qualifiers
  return s.addFamily(QUOTA_FAMILY_USAGE)
      .setFilter(new ColumnPrefixFilter(QUOTA_SNAPSHOT_SIZE_QUALIFIER));
}
 
源代码2 项目: hbase   文件: QuotaTableUtil.java
static Scan createScanForSpaceSnapshotSizes(TableName table) {
  Scan s = new Scan();
  if (null == table) {
    // Read all tables, just look at the row prefix
    s.setRowPrefixFilter(QUOTA_TABLE_ROW_KEY_PREFIX);
  } else {
    // Fetch the exact row for the table
    byte[] rowkey = getTableRowKey(table);
    // Fetch just this one row
    s.withStartRow(rowkey).withStopRow(rowkey, true);
  }

  // Just the usage family and only the snapshot size qualifiers
  return s.addFamily(QUOTA_FAMILY_USAGE).setFilter(
      new ColumnPrefixFilter(QUOTA_SNAPSHOT_SIZE_QUALIFIER));
}
 
源代码3 项目: attic-apex-malhar   文件: HBaseScanOperatorTest.java
@Override
public Scan operationScan()
{
  Scan scan = new Scan();
  Filter f = new ColumnPrefixFilter(Bytes.toBytes("col-0"));
  scan.setFilter(f);
  return scan;
}
 
源代码4 项目: hbase   文件: TestPartialResultsFromClientSide.java
/**
 * Test partial Result re-assembly in the presence of different filters. The Results from the
 * partial scanner should match the Results returned from a scanner that receives all of the
 * results in one RPC to the server. The partial scanner is tested with a variety of different
 * result sizes (all of which are less than the size necessary to fetch an entire row)
 * @throws Exception
 */
@Test
public void testPartialResultsWithColumnFilter() throws Exception {
  testPartialResultsWithColumnFilter(new FirstKeyOnlyFilter());
  testPartialResultsWithColumnFilter(new ColumnPrefixFilter(Bytes.toBytes("testQualifier5")));
  testPartialResultsWithColumnFilter(new ColumnRangeFilter(Bytes.toBytes("testQualifer1"), true,
      Bytes.toBytes("testQualifier7"), true));

  Set<byte[]> qualifiers = new LinkedHashSet<>();
  qualifiers.add(Bytes.toBytes("testQualifier5"));
  testPartialResultsWithColumnFilter(new FirstKeyValueMatchingQualifiersFilter(qualifiers));
}
 
源代码5 项目: phoenix-omid   文件: TestFilters.java
@Test(timeOut = 60_000)
public void testGetWithColumnPrefixFilter(ITestContext context) throws Exception {
    testGet(context, new ColumnPrefixFilter(prefix));
}
 
源代码6 项目: phoenix-omid   文件: TestFilters.java
@Test(timeOut = 60_000)
public void testScanWithColumnPrefixFilter(ITestContext context) throws Exception {
    testScan(context, new ColumnPrefixFilter(prefix));
}
 
源代码7 项目: spork   文件: TestHBaseStorageFiltering.java
private void assertPrefixFilter(Filter filter, String prefix) {
    assertTrue("Filter is not a ColumnPrefixFilter: " + filter.getClass().getSimpleName(),
            filter instanceof ColumnPrefixFilter);
    ColumnPrefixFilter familyFilter = (ColumnPrefixFilter)filter;
    assertEquals("Unexpected prefix", prefix, Bytes.toString(familyFilter.getPrefix()));
}
 
 类所在包
 类方法
 同包方法