/** * Use this constructor when not inside a coprocessor. This should only happen in: * <ul> * <li>the Master, for writing the configuration</li> * <li>test cases, for writing and reading/verifying</li> * </ul> */ public ConfigurationReader(final Configuration hbaseConf, final CConfiguration cConf) { this(new ConfigurationTableProvider() { private final String tableName = HTableNameConverter.getSysConfigTablePrefix(cConf.get(Constants.Dataset.TABLE_PREFIX)) + TABLE_NAME; @Override public HTableInterface get() throws IOException { return new HTable(hbaseConf, tableName); } @Override public String getTableName() { return tableName; } }); }
/** * Use this constructor when not inside a coprocessor. This should only happen in: * <ul> * <li>the Master, for writing the configuration</li> * <li>test cases, for writing and reading/verifying</li> * </ul> */ public ConfigurationReader(final Configuration hbaseConf, final CConfiguration cConf) { this(new ConfigurationTableProvider() { private final String tableName = HTableNameConverter.getSysConfigTablePrefix(cConf.get(Constants.Dataset.TABLE_PREFIX)) + TABLE_NAME; @Override public HTableInterface get() throws IOException { return new HTable(hbaseConf, tableName); } @Override public String getTableName() { return tableName; } }); }
@Test public void testGetSysConfigTablePrefix() throws Exception { CConfiguration cConf = CConfiguration.create(); String tablePrefix = cConf.get(Constants.Dataset.TABLE_PREFIX); Assert.assertEquals(tablePrefix + "_system:", HTableNameConverter.getSysConfigTablePrefix(tablePrefix)); } }