@Test(expected=IllegalArgumentException.class) public void testCreateRecordTableDescriptor_WithDotInName() { LilyHBaseSchema.createRecordTableDescriptor("myrepo", "my.recordtable"); }
@VisibleForTesting static HTableDescriptor createRecordTableDescriptor(String repositoryName, String tableName) { if (tableName.contains(".") || tableName.contains(":")) { throw new IllegalArgumentException("Repository table name cannot contain periods or colons"); } String hbaseTableName = RepoAndTableUtil.getHBaseTableName(repositoryName, tableName); HTableDescriptor recordTableDescriptor = new HTableDescriptor(hbaseTableName); recordTableDescriptor.addFamily(DATA_CF); recordTableDescriptor.setValue(TABLE_TYPE_PROPERTY, TABLE_TYPE_RECORD); RepoAndTableUtil.setRepositoryOwnership(recordTableDescriptor, repositoryName); return recordTableDescriptor; }
LilyHBaseSchema { @VisibleForTesting static HTableDescriptor createRecordTableDescriptor(String repositoryName, String tableName) { if (tableName.contains(".") || tableName.contains(":")) { throw new IllegalArgumentException("Repository table name cannot contain periods or colons"); } String hbaseTableName = RepoAndTableUtil.getHBaseTableName(repositoryName, tableName); HTableDescriptor recordTableDescriptor = new HTableDescriptor(hbaseTableName); recordTableDescriptor.addFamily(DATA_CF); recordTableDescriptor.setValue(TABLE_TYPE_PROPERTY, TABLE_TYPE_RECORD); RepoAndTableUtil.setRepositoryOwnership(recordTableDescriptor, repositoryName); return recordTableDescriptor; } }
LilyHBaseSchema { @VisibleForTesting static HTableDescriptor createRecordTableDescriptor(String repositoryName, String tableName) { if (tableName.contains(".") || tableName.contains(":")) { throw new IllegalArgumentException("Repository table name cannot contain periods or colons"); } String hbaseTableName = RepoAndTableUtil.getHBaseTableName(repositoryName, tableName); HTableDescriptor recordTableDescriptor = new HTableDescriptor(hbaseTableName); recordTableDescriptor.addFamily(DATA_CF); recordTableDescriptor.setValue(TABLE_TYPE_PROPERTY, TABLE_TYPE_RECORD); RepoAndTableUtil.setRepositoryOwnership(recordTableDescriptor, repositoryName); return recordTableDescriptor; } private  LilyHBaseSchema(); }
LilyHBaseSchema { @VisibleForTesting static HTableDescriptor createRecordTableDescriptor(String repositoryName, String tableName) { if (tableName.contains(".") || tableName.contains(":")) { throw new IllegalArgumentException("Repository table name cannot contain periods or colons"); } String hbaseTableName = RepoAndTableUtil.getHBaseTableName(repositoryName, tableName); HTableDescriptor recordTableDescriptor = new HTableDescriptor(hbaseTableName); recordTableDescriptor.addFamily(DATA_CF); recordTableDescriptor.setValue(TABLE_TYPE_PROPERTY, TABLE_TYPE_RECORD); RepoAndTableUtil.setRepositoryOwnership(recordTableDescriptor, repositoryName); return recordTableDescriptor; } private  LilyHBaseSchema(); static boolean isRecordTableDescriptor(HTableDescriptor htableDescriptor); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName, byte[][] splitKeys); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName, boolean clientMode); static HTableInterface getTypeTable(HBaseTableFactory tableFactory); static HTableInterface getBlobIncubatorTable(HBaseTableFactory tableFactory, boolean clientMode); }
LilyHBaseSchema { @VisibleForTesting static HTableDescriptor createRecordTableDescriptor(String repositoryName, String tableName) { if (tableName.contains(".") || tableName.contains(":")) { throw new IllegalArgumentException("Repository table name cannot contain periods or colons"); } String hbaseTableName = RepoAndTableUtil.getHBaseTableName(repositoryName, tableName); HTableDescriptor recordTableDescriptor = new HTableDescriptor(hbaseTableName); recordTableDescriptor.addFamily(DATA_CF); recordTableDescriptor.setValue(TABLE_TYPE_PROPERTY, TABLE_TYPE_RECORD); RepoAndTableUtil.setRepositoryOwnership(recordTableDescriptor, repositoryName); return recordTableDescriptor; } private  LilyHBaseSchema(); static boolean isRecordTableDescriptor(HTableDescriptor htableDescriptor); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName, byte[][] splitKeys); static HTableInterface getRecordTable(HBaseTableFactory tableFactory, String repositoryName, String tableName, boolean clientMode); static HTableInterface getTypeTable(HBaseTableFactory tableFactory); static HTableInterface getBlobIncubatorTable(HBaseTableFactory tableFactory, boolean clientMode); static final byte[] TABLE_TYPE_PROPERTY; static final byte[] TABLE_TYPE_RECORD; }