Package org.kiji.schema.avro

Examples of org.kiji.schema.avro.RowKeyComponent


      builder.setSalt(new HashSpec(HashType.MD5, hashLength, false));
    }
    List<RowKeyComponent> components = Lists.newArrayList();
    char field = 'a';
    for (ComponentType componentType : componentTypes) {
      components.add(new RowKeyComponent(String.valueOf(field), componentType));
      field = (char) (field + 1);
    }
    builder.setComponents(components);
    return builder.build();
  }
View Full Code Here


        .setEncoding(RowKeyEncoding.FORMATTED)
        .setSalt(new HashSpec(HashType.MD5, hashLength, false))
        .setRangeScanStartIndex(1);

    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);
View Full Code Here

    runTest(new FormattedEntityIdRowFilter(
        RowKeyFormat2.newBuilder()
            .setEncoding(RowKeyEncoding.FORMATTED)
            .setSalt(new HashSpec(HashType.MD5, 1, false))
            .setComponents(ImmutableList.of(
                new RowKeyComponent("a", ComponentType.INTEGER),
                new RowKeyComponent("b", ComponentType.LONG),
                new RowKeyComponent("c", ComponentType.STRING)))
            .build(),
        100, null, "value"));
  }
View Full Code Here

      final List<RowKeyComponent> formatComponents = mKeyFormat.getComponents();
      final Object[] components = new Object[formatComponents.size()];

      for (int i = 0; i < formatComponents.size(); i++) {
        RowKeyComponent component = formatComponents.get(i);
        // TODO: investigate whether we can do this by position instead of creating a bunch of
        // garbage through column name translation
        final String columnName =
            CQLUtils.translateEntityIDComponentNameToColumnName(component.getName());
        switch (component.getType()) {
          case STRING: {
            components[i] = row.getString(columnName);
            break;
          }
          case INTEGER: {
View Full Code Here

TOP

Related Classes of org.kiji.schema.avro.RowKeyComponent

Copyright © 2018 www.massapicom. 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.