Creating the Configuration Object
Function Description
HBase obtains configuration items by loading a configuration file, including user login information configuration items.
Sample Code
The following code snippets are in the com.huawei.bigdata.hbase.examples packet.
Invoke the init () method under the TestMain class to initialize the Configuration object.
private static void init() throws IOException { // load hbase client info if(clientInfo == null) { clientInfo = new ClientInfo(CONF_DIR + HBASE_CLIENT_PROPERTIES); restServerInfo = clientInfo.getRestServerInfo(); } // Default load from conf directory conf = HBaseConfiguration.create(); conf.addResource(CONF_DIR + "core-site.xml"); conf.addResource(CONF_DIR + "hdfs-site.xml"); conf.addResource(CONF_DIR + "hbase-site.xml"); }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot