/** * Constructor using the coprocessor environment. In order to construct the correct table name, * the CDAP table namespace prefix must be provided. This is configured in the {@link CConfiguration} * as well as an attribute for the HBase tables created by CDAP; in both cases with the key * {@link Constants.Dataset#TABLE_PREFIX}. * * @param env the coprocessor environment * @param tablePrefix the namespace prefix used for CDAP tables */ public CoprocessorCConfigurationReader(final CoprocessorEnvironment env, final String tablePrefix) { super(new ConfigurationTableProvider() { private final TableName tableName = TableName.valueOf(HTableNameConverter.getSystemNamespace(tablePrefix), ConfigurationReader.TABLE_NAME); @Override public HTableInterface get() throws IOException { return env.getTable(tableName); } @Override public String getTableName() { return tableName.toString(); } }); }
/** * Constructor using the coprocessor environment. In order to construct the correct table name, * the CDAP table namespace prefix must be provided. This is configured in the {@link CConfiguration} * as well as an attribute for the HBase tables created by CDAP; in both cases with the key * {@link Constants.Dataset#TABLE_PREFIX}. * * @param env the coprocessor environment * @param tablePrefix the namespace prefix used for CDAP tables */ public CoprocessorCConfigurationReader(final CoprocessorEnvironment env, final String tablePrefix) { super(new ConfigurationTableProvider() { private final TableName tableName = TableName.valueOf(HTableNameConverter.getSystemNamespace(tablePrefix), ConfigurationReader.TABLE_NAME); @Override public HTableInterface get() throws IOException { return env.getTable(tableName); } @Override public String getTableName() { return tableName.toString(); } }); }