/** * Translates a Fiji table layout into an HColumnDescriptor. * * @param fijiInstanceName The name of the Fiji instance the table lives in. * @param tableLayout The Fiji table layout. * @return The HTableDescriptor to use for storing the Fiji table data. */ public HTableDescriptor toHTableDescriptor(String fijiInstanceName, FijiTableLayout tableLayout) { // Figure out the name of the table. final String tableName = tableLayout.getName(); final FijiManagedHBaseTableName hbaseTableName = FijiManagedHBaseTableName.getFijiTableName(fijiInstanceName, tableName); final HTableDescriptor tableDescriptor = new HTableDescriptor(hbaseTableName.toString()); TableLayoutDesc tableLayoutDesc = tableLayout.getDesc(); if (tableLayoutDesc.getMaxFilesize() != null) { tableDescriptor.setMaxFileSize(tableLayoutDesc.getMaxFilesize()); } if (tableLayoutDesc.getMemstoreFlushsize() != null) { tableDescriptor.setMemStoreFlushSize(tableLayoutDesc.getMemstoreFlushsize()); } HBaseColumnNameTranslator translator = HBaseColumnNameTranslator.from(tableLayout); // Add the columns. for (LocalityGroupLayout localityGroup : tableLayout.getLocalityGroupMap().values()) { tableDescriptor.addFamily(toHColumnDescriptor(localityGroup, translator)); } return tableDescriptor; }
final HTableSchemaTranslator translator = new HTableSchemaTranslator(); final HTableDescriptor newTableDescriptor = translator.toHTableDescriptor(tableURI.getInstance(), newLayout);
final HTableSchemaTranslator translator = new HTableSchemaTranslator(); final HTableDescriptor desc = translator.toHTableDescriptor(tableURI.getInstance(), fijiTableLayout); LOG.debug("Creating HBase table '{}'.", desc.getNameAsString()); if (null != splitKeys) {