Examples of RowKeyFormat2


Examples of org.kiji.schema.avro.RowKeyFormat2

    runTest(mRowKeyFormat, filter, mFactory, EXCLUDE, 50, 5999L, "anything");
  }

  @Test
  public void testPrefixNumberMatching() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, LONG, LONG);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 4224L, null);
    runTest(rowKeyFormat, filter, factory, INCLUDE, 4224L, 5005L);
    runTest(rowKeyFormat, filter, factory, INCLUDE, 4224L, null);
    runTest(rowKeyFormat, filter, factory, INCLUDE, 4224L, Long.MAX_VALUE);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    runTest(rowKeyFormat, filter, factory, EXCLUDE, Long.MIN_VALUE, Long.MIN_VALUE);
  }

  @Test
  public void testUnicodeStringInFilterMatching() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, STRING);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);
    String match = "This is a star: \u2605";
    String noMatch = "This is not a star";
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, match);
    runTest(rowKeyFormat, filter, factory, INCLUDE, match);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    runTest(rowKeyFormat, filter, factory, EXCLUDE, noMatch);
  }

  @Test
  public void testUnicodeStringInEntityIdMatching() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, STRING);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);
    String match = "This is not a star";
    String noMatch = "This is a star: \u2605";
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, match);
    runTest(rowKeyFormat, filter, factory, INCLUDE, match);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    runTest(mRowKeyFormat, filter, mFactory, EXCLUDE, 0, null, null);
  }

  @Test
  public void testLatinNewlineCharacterInclusion() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, INTEGER, LONG);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);

    // Create and serialize a filter.
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 10);
    byte[] serializedFilter = filter.toHBaseFilter(null).toByteArray();
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    List<RowKeyComponent> components = ImmutableList.of(
            new RowKeyComponent("id", INTEGER), // this one is included in the hash
            new RowKeyComponent("ts", LONG));   // this one is not
    builder.setComponents(components);
    RowKeyFormat2 rowKeyFormat = builder.build();

    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 100);
    Object[] componentValues = new Object[] { Integer.valueOf(100), Long.valueOf(900000L) };
    runTest(rowKeyFormat, filter, factory, INCLUDE, componentValues);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    doInclusionAssert(rowKeyFormat, filter, entityId, hbaseFilter, hbaseKey, EXCLUDE);
  }

  @Test
  public void testHashWildcardIsUsedForMissingHashComponents() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, INTEGER, LONG, STRING);
    rowKeyFormat.setRangeScanStartIndex(2);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);

    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 100, null, "value");
    runTest(rowKeyFormat, filter, factory, INCLUDE, 100, 2000L, "value");
    runTest(rowKeyFormat, filter, factory, EXCLUDE, 100, null, null);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    runTest(rowKeyFormat, filter, factory, EXCLUDE, 0, null, null);
  }

  @Test
  public void testPrefixFilterHaltsFiltering() throws Exception {
    RowKeyFormat2 rowKeyFormat = createRowKeyFormat(1, INTEGER, LONG, LONG);
    EntityIdFactory factory = EntityIdFactory.getFactory(rowKeyFormat);
    FormattedEntityIdRowFilter filter = createFilter(rowKeyFormat, 100, null, 9000L);
    Filter hbaseFilter = filter.toHBaseFilter(null);

    EntityId passingEntityId = factory.getEntityId(100, 100L, 9000L);
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();
    components.add(RowKeyComponent.newBuilder()
        .setName("NAME").setType(ComponentType.STRING).build());

    // build the row key format
    RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)
        .setSalt(HashSpec.newBuilder().build())
        .setComponents(components)
        .build();

    return format;
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

    ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();
    components.add(RowKeyComponent.newBuilder()
        .setName("NAME").setType(ComponentType.STRING).build());

    // build the row key format
    RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)
        .setSalt(HashSpec.newBuilder().build())
        .setComponents(components)
        .build();

    return format;
View Full Code Here

Examples of org.kiji.schema.avro.RowKeyFormat2

  // Invalid row key format
  private RowKeyFormat2 noComponentsRowKeyFormat() {
    // components of the row key
    ArrayList<RowKeyComponent> components = new ArrayList<RowKeyComponent>();
    // build the row key format
    RowKeyFormat2 format = RowKeyFormat2.newBuilder().setEncoding(RowKeyEncoding.FORMATTED)
        .setSalt(HashSpec.newBuilder().build())
        .setComponents(components)
        .build();

    return format;
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.