Examples of TableLayoutDesc


Examples of org.kiji.schema.avro.TableLayoutDesc

  /** Tests for a layout with a single locality group, and with no reference layout. */
  @Test
  public void testLayoutWithNoReference() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
          LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  /** Tests for a layout with one map family, and with no reference layout. */
  @Test
  public void testMapFamilyLayoutWithNoReference() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  /** Tests for a layout with one column, and with no reference layout. */
  @Test
  public void testGroupFamilyLayoutWithNoReference() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
          makeMinimalLocalityGroup()))
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  /** Tests for column removal. */
  @Test
  public void testDeleteColumn() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    // Reference layout with a single column : "family_name:column_name"
    final TableLayoutDesc refDesc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
          makeMinimalLocalityGroup()))
        .build();
    final KijiTableLayout refLayout = KijiTableLayout.newLayout(refDesc);

    {
      // Target layout deleting the column
      final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
          .setName("table_name")
          .setKeysFormat(format)
          .setVersion(TABLE_LAYOUT_VERSION)
          .setLocalityGroups(Lists.newArrayList(
              LocalityGroupDesc.newBuilder()
              .setName("locality_group_name")
              .setInMemory(false)
              .setTtlSeconds(84600)
              .setMaxVersions(1)
              .setCompressionType(CompressionType.GZ)
              .setFamilies(Lists.newArrayList(
                  FamilyDesc.newBuilder()
                      .setName("family_name")
                      .setColumns(Lists.newArrayList(
                          ColumnDesc.newBuilder()
                              .setName("column_name")
                              .setColumnSchema(CellSchema.newBuilder()
                                   .setStorage(SchemaStorage.UID)
                                   .setType(SchemaType.INLINE)
                                   .setValue("\"string\"")
                                   .build())
                              .setDelete(true)
                              .build()))
                      .build()))
              .build()))
          .build();
      final KijiTableLayout layout = KijiTableLayout.createUpdatedLayout(desc, refLayout);
      final KijiTableLayout.LocalityGroupLayout.FamilyLayout fLayout =
          layout.getFamilyMap().get("family_name");
      assertNotNull(fLayout);
      assertTrue(fLayout.getColumns().isEmpty());
      assertTrue(fLayout.getColumnMap().isEmpty());
    }

    {
      // Target layout with an invalid column deletion
      final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
          .setName("table_name")
          .setKeysFormat(format)
          .setVersion(TABLE_LAYOUT_VERSION)
          .setLocalityGroups(Lists.newArrayList(
              LocalityGroupDesc.newBuilder()
              .setName("locality_group_name")
              .setInMemory(false)
              .setTtlSeconds(84600)
              .setMaxVersions(1)
              .setCompressionType(CompressionType.GZ)
              .setFamilies(Lists.newArrayList(
                  FamilyDesc.newBuilder()
                      .setName("family_name")
                      .build()))
              .build()))
          .build();
      try {
        KijiTableLayout.createUpdatedLayout(desc, refLayout);
        Assert.fail("Layout update with missing column did not fail.");
      } catch (InvalidLayoutException ile) {
        // Exception is expected!
      }
    }

    {
      // Target layout with an invalid column rename
      final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
          .setName("table_name")
          .setKeysFormat(format)
          .setVersion(TABLE_LAYOUT_VERSION)
          .setLocalityGroups(Lists.newArrayList(
              LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

    final Kiji kiji = getKiji();
    final KijiMetaTable metaTable = kiji.getMetaTable();
    final KijiSchemaTable schemaTable = kiji.getSchemaTable();
    final KijiSystemTable systemTable = kiji.getSystemTable();

    final TableLayoutDesc layout = KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST);
    final KijiTableLayout updatedLayout = metaTable.updateTableLayout("foo", layout);
    metaTable.putValue("foo", "key", BYTES_VALUE);

    systemTable.putValue("testKey", Bytes.toBytes("testValue"));
    assertEquals(1, metaTable.listTables().size());
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

    // Use the KijiMetaTable obj returned by this to modify the underlying db.
    // Verify that the original KijiMetaTable sees the change.
    final Kiji kiji = getKiji();
    final KijiMetaTable metaTable = kiji.getMetaTable();

    final TableLayoutDesc layout = KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST);
    final KijiTableLayout updatedLayout = metaTable.updateTableLayout("foo", layout);

    final KijiMetaTable outMeta = metaTable.putValue("foo", "key", BYTES_VALUE);
    assertEquals("putValue() exposes the delegate", metaTable, outMeta);
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  @Test
  public void testNameAliases() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    // Reference layout with a single column: "family_name:column_name"
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  /** Tests the initial assignment of IDs to locality groups, families and columns. */
  @Test
  public void testIdAssignmentWithNoReference() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    // Reference layout with a single column: "family_name:column_name"
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  @Test
  public void testDuplicateFamilyName() throws Exception {
    RowKeyFormat2 format = makeHashPrefixedRowKeyFormat();
    // Reference layout with a single column: "family_name:column_name"
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(format)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

Examples of org.kiji.schema.avro.TableLayoutDesc

  }

  @Test
  public void testZeroMaxFilesize() throws Exception {
    // Simple layout with minimal config
    final TableLayoutDesc desc = TableLayoutDesc.newBuilder(makeMinimalValidLayout())
      .setMaxFilesize(0L)
      .build();
    try {
      KijiTableLayout.newLayout(desc);
      fail("max_filesize of 0 didn't throw exception.");
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.