MapReduce服务 MRS-创建Configuration:代码样例

时间:2025-02-12 14:58:43

代码样例

下面代码片段在com.huawei.bigdata.hbase.examples包中。

调用类TestMain下的init()方法会初始化Configuration对象:

    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");    }
support.huaweicloud.com/devg-mrs/mrs_06_0016.html