Examples of FamilyOnlyFilter


Examples of org.apache.phoenix.hbase.index.covered.filter.FamilyOnlyFilter

  @Test
  public void testPassesFirstFamily() {
    byte[] fam = Bytes.toBytes("fam");
    byte[] fam2 = Bytes.toBytes("fam2");

    FamilyOnlyFilter filter = new FamilyOnlyFilter(fam);

    KeyValue kv = new KeyValue(row, fam, qual, 10, val);
    ReturnCode code = filter.filterKeyValue(kv);
    assertEquals("Didn't pass matching family!", ReturnCode.INCLUDE, code);

    kv = new KeyValue(row, fam2, qual, 10, val);
    code = filter.filterKeyValue(kv);
    assertEquals("Didn't filter out non-matching family!", ReturnCode.SKIP, code);
  }
View Full Code Here

Examples of org.apache.phoenix.hbase.index.covered.filter.FamilyOnlyFilter

  public void testPassesTargetFamilyAsNonFirstFamily() {
    byte[] fam = Bytes.toBytes("fam");
    byte[] fam2 = Bytes.toBytes("fam2");
    byte[] fam3 = Bytes.toBytes("way_after_family");

    FamilyOnlyFilter filter = new FamilyOnlyFilter(fam2);

    KeyValue kv = new KeyValue(row, fam, qual, 10, val);

    ReturnCode code = filter.filterKeyValue(kv);
    assertEquals("Didn't filter out non-matching family!", ReturnCode.SKIP, code);

    kv = new KeyValue(row, fam2, qual, 10, val);
    code = filter.filterKeyValue(kv);
    assertEquals("Didn't pass matching family", ReturnCode.INCLUDE, code);

    kv = new KeyValue(row, fam3, qual, 10, val);
    code = filter.filterKeyValue(kv);
    assertEquals("Didn't filter out non-matching family!", ReturnCode.SKIP, code);
  }
View Full Code Here

Examples of org.apache.phoenix.hbase.index.covered.filter.FamilyOnlyFilter

  public void testResetFilter() {
    byte[] fam = Bytes.toBytes("fam");
    byte[] fam2 = Bytes.toBytes("fam2");
    byte[] fam3 = Bytes.toBytes("way_after_family");

    FamilyOnlyFilter filter = new FamilyOnlyFilter(fam2);

    KeyValue kv = new KeyValue(row, fam, qual, 10, val);

    ReturnCode code = filter.filterKeyValue(kv);
    assertEquals("Didn't filter out non-matching family!", ReturnCode.SKIP, code);

    KeyValue accept = new KeyValue(row, fam2, qual, 10, val);
    code = filter.filterKeyValue(accept);
    assertEquals("Didn't pass matching family", ReturnCode.INCLUDE, code);

    kv = new KeyValue(row, fam3, qual, 10, val);
    code = filter.filterKeyValue(kv);
    assertEquals("Didn't filter out non-matching family!", ReturnCode.SKIP, code);

    // we shouldn't match the family again - everything after a switched family should be ignored
    code = filter.filterKeyValue(accept);
    assertEquals("Should have skipped a 'matching' family if it arrives out of order",
      ReturnCode.SKIP, code);

    // reset the filter and we should accept it again
    filter.reset();
    code = filter.filterKeyValue(accept);
    assertEquals("Didn't pass matching family after reset", ReturnCode.INCLUDE, code);
  }
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.