@Test public void testAdaptForTable() { GCRule gcRule = GCRULES.maxVersions(1); ColumnFamily columnFamily = ColumnFamily.newBuilder().setGcRule(gcRule.toProto()).build(); Table table = Table.newBuilder() .setName(TABLE_NAME) .putColumnFamilies(COLUMN_FAMILY, columnFamily) .build(); HTableDescriptor actualTableDesc = TableAdapter.adapt(com.google.cloud.bigtable.admin.v2.models.Table.fromProto(table)); HTableDescriptor expected = new HTableDescriptor(TableName.valueOf(TABLE_ID)); expected.addFamily(new HColumnDescriptor(COLUMN_FAMILY)); Assert.assertEquals(expected, actualTableDesc); }
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);  }