Package org.kiji.schema.avro

Examples of org.kiji.schema.avro.TableLayoutDesc


    assertEquals(1, cLayout.getId().getId());
  }

  @Test
  public void testRenameColumn() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here


    assertEquals(1, fLayout2.getColumnMap().get("renamed_column_name").getId().getId());
  }

  @Test
  public void testIllegalImplicitColumnRenaming() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

    }
  }

  @Test
  public void testRenameFamily() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

    assertNotNull(cLayout2);
  }

  @Test
  public void testIllegalImplicitFamilyRenaming() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

    }
  }

  @Test
  public void testRenameLocalityGroup() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

    assertNotNull(lgLayout2.getFamilyMap().get("family_name"));
  }

  @Test
  public void testIllegalImplicitLocalityGroupRenaming() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(mFormat)
        .setVersion(TABLE_LAYOUT_VERSION)
        .setLocalityGroups(Lists.newArrayList(
            LocalityGroupDesc.newBuilder()
View Full Code Here

  }

  /** Changing schema storage is not allowed and should fail. */
  @Test
  public void testChangeSchemaStorage() throws Exception {
    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(RowKeyFormat.newBuilder()
            .setEncoding(RowKeyEncoding.HASH_PREFIX)
            .build())
        .setVersion(TABLE_LAYOUT_VERSION)
View Full Code Here

  }

  /** Final column schema cannot change. */
  @Test
  public void testChangeFinalColumnSchema() throws Exception {
    final TableLayoutDesc desc1 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(RowKeyFormat.newBuilder()
            .setEncoding(RowKeyEncoding.HASH_PREFIX)
            .build())
        .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.FINAL)
                                 .setType(SchemaType.COUNTER)
                                 .build())
                            .build()))
                    .build()))
            .build()))
        .build();
    final KijiTableLayout refLayout = KijiTableLayout.newLayout(desc1);

    final TableLayoutDesc desc2 = TableLayoutDesc.newBuilder()
        .setName("table_name")
        .setKeysFormat(RowKeyFormat.newBuilder()
            .setEncoding(RowKeyEncoding.HASH_PREFIX)
            .build())
        .setVersion(TABLE_LAYOUT_VERSION)
View Full Code Here

  private static final String SINGLE_COMPONENT_EID =
      String.format("[%s]", JSONObject.quote(UNUSUAL_STRING_EID));

  @Test
  public void testShouldWorkWithRKFRawLayout() throws Exception {
    final TableLayoutDesc desc =
        KijiTableLayouts.getLayout(KijiTableLayouts.COUNTER_TEST);
    final KijiTableLayout layout = KijiTableLayout.newLayout(desc);
    final EntityIdFactory factory = EntityIdFactory.getFactory(layout);
    final byte[] rowKey = Bytes.toBytes(UNUSUAL_STRING_EID);
    final EntityId originalEid = factory.getEntityIdFromHBaseRowKey(rowKey);
View Full Code Here

    assertEquals(originalEid, restEid3.getEntityId());
  }

  @Test
  public void testShouldWorkWithRKFHashedLayout() throws Exception {
    final TableLayoutDesc desc =
        KijiTableLayouts.getLayout(KijiTableLayouts.FOODS);
    final KijiTableLayout layout = KijiTableLayout.newLayout(desc);
    final EntityIdFactory factory = EntityIdFactory.getFactory(layout);

    // Byte array representations of row keys should work.
View Full Code Here

TOP

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

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.