Package org.kiji.schema.layout.impl

Examples of org.kiji.schema.layout.impl.HTableSchemaTranslator


import org.kiji.schema.layout.impl.HTableSchemaTranslator;

public class TestHTableSchemaTranslator {
  @Test
  public void testTranslate() throws Exception {
    final HTableSchemaTranslator translator = new HTableSchemaTranslator();

    final KijiTableLayout tableLayout =
        KijiTableLayout.newLayout(KijiTableLayouts.getLayout(KijiTableLayouts.FULL_FEATURED));

    final KijiURI tableURI =
        KijiURI
            .newBuilder()
            .withInstanceName("myinstance")
            .withTableName(tableLayout.getName()).build();
    final HTableDescriptor tableDescriptor =
        translator.toHTableDescriptor(tableURI.getInstance(), tableLayout);

    assertEquals("kiji.myinstance.table.user", tableDescriptor.getNameAsString());
    assertEquals(2, tableDescriptor.getColumnFamilies().length);

    assertFalse(tableDescriptor.getFamily(Bytes.toBytes("B")).isInMemory());
View Full Code Here


    if (dryRun) {
      printStream.println("This table layout is valid.");
    }

    LOG.debug("Computing new HBase schema");
    final HTableSchemaTranslator translator = new HTableSchemaTranslator();
    final HTableDescriptor newTableDescriptor =
        translator.toHTableDescriptor(tableURI.getInstance(), newLayout);

    LOG.debug("Reading existing HBase schema");
    final KijiManagedHBaseTableName hbaseTableName =
        KijiManagedHBaseTableName.getKijiTableName(mURI.getInstance(), tableName);
    HTableDescriptor currentTableDescriptor = null;
View Full Code Here

        ZooKeeperUtils.wrapAndRethrow(e);
      }
    }

    try {
      final HTableSchemaTranslator translator = new HTableSchemaTranslator();
      final HTableDescriptor desc =
          translator.toHTableDescriptor(tableURI.getInstance(), kijiTableLayout);
      LOG.debug("Creating HBase table '{}'.", desc.getNameAsString());
      if (null != splitKeys) {
        getHBaseAdmin().createTable(desc, splitKeys);
      } else {
        getHBaseAdmin().createTable(desc);
View Full Code Here

TOP

Related Classes of org.kiji.schema.layout.impl.HTableSchemaTranslator

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.