public class ConfigurationTable extends Object
CConfiguration to a table in HBase. This make the configuration available
to processes running on the HBase servers (such as coprocessors). The entire configuration is stored in
a single row, keyed by the configuration type (to allow future expansion), with the configuration
key as the column name, and the configuration value as the value.| Modifier and Type | Class and Description |
|---|---|
static class |
ConfigurationTable.Type
Defines the types of configurations to save in the table.
|
| Constructor and Description |
|---|
ConfigurationTable(Configuration hbaseConf) |
| Modifier and Type | Method and Description |
|---|---|
CConfiguration |
read(ConfigurationTable.Type type,
String sysConfigTablePrefix)
Reads the given configuration type from the HBase table, looking for the HBase table name under the
given "sysConfigTablePrefix".
|
void |
write(ConfigurationTable.Type type,
CConfiguration cConf)
Writes the
CConfiguration instance as a new row to the HBase table. |
public ConfigurationTable(Configuration hbaseConf)
public void write(ConfigurationTable.Type type, CConfiguration cConf) throws IOException
CConfiguration instance as a new row to the HBase table. The ConfigurationTable.Type given is used as
the row key (allowing multiple configurations to be stored). After the new configuration is written, this will
delete any configurations written with an earlier timestamp (to prevent removed values from being visible).cConf - The CConfiguration instance to storeIOException - If an error occurs while writing the configurationpublic CConfiguration read(ConfigurationTable.Type type, String sysConfigTablePrefix) throws IOException
type - Type of configuration to read insysConfigTablePrefix - table prefix of the configuration table. (The full table name of the configuration
table minus the table qualifier). Example: 'cdap.system:'CConfiguration instance populated with the stored values, or null if no row
was found for the given type.IOException - If an error occurs while attempting to read the table or the table does not exist.Copyright © 2016 Cask Data, Inc. Licensed under the Apache License, Version 2.0.