Package org.apache.hadoop.hbase.filter

Examples of org.apache.hadoop.hbase.filter.Filter.filterRowKey()


    Filter deserializedFilter = FilterList.parseFrom(serializedFilter);

    // Filter an entity with the deserialized filter.
    EntityId entityId = factory.getEntityId(10, 10L);
    byte[] hbaseKey = entityId.getHBaseRowKey();
    boolean filtered = deserializedFilter.filterRowKey(hbaseKey, 0, hbaseKey.length);
    assertEquals(INCLUDE, filtered);
  }

  @Test
  public void testHashIsCalculatedWhenAllHashComponentsAreSpecified() throws Exception {
View Full Code Here


    // A row key with a different hash but the same first component should be
    // excluded by the filter. The hash is 0x9f0f
    hbaseKey[0] = (byte) 0x7F;
    hbaseKey[1] = (byte) 0xFF;
    boolean filtered = hbaseFilter.filterRowKey(hbaseKey, 0, hbaseKey.length);
    doInclusionAssert(rowKeyFormat, filter, entityId, hbaseFilter, hbaseKey, EXCLUDE);
  }

  @Test
  public void testHashWildcardIsUsedForMissingHashComponents() throws Exception {
View Full Code Here

      List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size());
      for (KeyValue kv : kvs) {
        if (filter.filterAllRemaining()) {
          break;
        }
        if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())) {
          continue;
        }
        if (filter.filterKeyValue(kv) == ReturnCode.INCLUDE) {
          nkvs.add(kv);
        }
View Full Code Here

        List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size());
        for (KeyValue kv : kvs) {
          if (filter.filterAllRemaining()) {
            break;
          }
          if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())) {
            continue;
          }
          ReturnCode filterResult = filter.filterKeyValue(kv);
          if (filterResult == ReturnCode.INCLUDE) {
            nkvs.add(kv);
View Full Code Here

            List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size());
            for (KeyValue kv : kvs) {
                if (filter.filterAllRemaining()) {
                    break;
                }
                if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())) {
                    continue;
                }
                if (filter.filterKeyValue(kv) == ReturnCode.INCLUDE) {
                    nkvs.add(kv);
                }
View Full Code Here

                List<KeyValue> nkvs = new ArrayList<KeyValue>(kvs.size());
                for (KeyValue kv : kvs) {
                    if (filter.filterAllRemaining()) {
                        break;
                    }
                    if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength())) {
                        continue;
                    }
                    ReturnCode filterResult = filter.filterKeyValue(kv);
                    if (filterResult == ReturnCode.INCLUDE) {
                        nkvs.add(kv);
View Full Code Here

      {
        if (filter.filterAllRemaining())
        {
          break;
        }
        if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength()))
        {
          continue;
        }
        if (filter.filterKeyValue(kv) == ReturnCode.INCLUDE)
        {
View Full Code Here

        {
          if (filter.filterAllRemaining())
          {
            break;
          }
          if (filter.filterRowKey(kv.getBuffer(), kv.getRowOffset(), kv.getRowLength()))
          {
            continue;
          }
          ReturnCode filterResult = filter.filterKeyValue(kv);
          if (filterResult == ReturnCode.INCLUDE)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.