Help Center/
CloudTable Service/
Developer Guide/
HBase Application Development Guide/
Developing HBase Applications/
HBase Cold and Hot Separation Data Sample Project/
Creating the Configuration Object
Updated on 2025-07-25 GMT+08:00
Creating the Configuration Object
Function Description
HBase obtains configuration items by loading a configuration file.

- Loading the configuration file is time-consuming. It is recommended to use the same Configuration object.
- Multi-thread synchronization is not considered in the sample code. If necessary, add it by yourself. Other sample codes are the same.
Sample Code
The following code snippets are in the com.huawei.cloudtable.hbase.examples.coldhotexample packet.
private static void init() throws IOException { // Default load from conf directory conf = HBaseConfiguration.create(); // Note [1] String userdir = System.getProperty("user.dir") + File.separator + "conf" + File.separator; Path hbaseSite = new Path(userdir + "hbase-site.xml"); if (new File(hbaseSite.toString()).exists()) { conf.addResource(hbaseSite); } }
Precautions
- Note [1] If the conf directory of the configuration file is added to the classpath path, the code for loading the specified configuration file can be skipped.
Note [1] refers to conf = HBaseConfiguration.create(); //Note [1] in the sample code.
Parent topic: HBase Cold and Hot Separation Data Sample Project
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot