@Test public void testAdaptWithColumnDesc() { HColumnDescriptor columnDesc = new HColumnDescriptor(COLUMN_FAMILY); HTableDescriptor desc = new HTableDescriptor(TableName.valueOf(TABLE_ID)); CreateTableRequest request = CreateTableRequest.of(TABLE_ID); desc.addFamily(columnDesc); TableAdapter.adapt(desc, request); GCRule gcRule = ColumnDescriptorAdapter.buildGarbageCollectionRule(columnDesc); CreateTableRequest expected = CreateTableRequest.of(TABLE_ID).addFamily(COLUMN_FAMILY, gcRule); Assert.assertEquals( request.toProto(PROJECT_ID, INSTANCE_ID), expected.toProto(PROJECT_ID, INSTANCE_ID)); }
protected static void adapt(HTableDescriptor desc, CreateTableRequest request) { if (request != null) { for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); request.addFamily(columnName, buildGarbageCollectionRule(column)); } } }
TableAdapter { protected static void adapt(HTableDescriptor desc, CreateTableRequest request) { if (request != null) { for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); request.addFamily(columnName, buildGarbageCollectionRule(column)); } } } }
TableAdapter { protected static void adapt(HTableDescriptor desc, CreateTableRequest request) { if (request != null) { for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); request.addFamily(columnName, buildGarbageCollectionRule(column)); } } } private  TableAdapter(); }
TableAdapter { protected static void adapt(HTableDescriptor desc, CreateTableRequest request) { if (request != null) { for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); request.addFamily(columnName, buildGarbageCollectionRule(column)); } } } private  TableAdapter(); static CreateTableRequest adapt(HTableDescriptor desc, byte[][] splitKeys); static void addSplitKeys(byte[][] splitKeys, CreateTableRequest request); static HTableDescriptor adapt(Table table); }
TableAdapter { protected static void adapt(HTableDescriptor desc, CreateTableRequest request) { if (request != null) { for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); request.addFamily(columnName, buildGarbageCollectionRule(column)); } } } private  TableAdapter(); static CreateTableRequest adapt(HTableDescriptor desc, byte[][] splitKeys); static void addSplitKeys(byte[][] splitKeys, CreateTableRequest request); static HTableDescriptor adapt(Table table);  }