You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shaofeng SHI (JIRA)" <ji...@apache.org> on 2018/12/05 06:31:00 UTC

[jira] [Assigned] (KYLIN-3709) Pass the wrong parameter to addResource function, kylin can not load the configuration file hbase.hdfs.xml .

     [ https://issues.apache.org/jira/browse/KYLIN-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shaofeng SHI reassigned KYLIN-3709:
-----------------------------------

    Assignee: Chao Long  (was: Shaofeng SHI)

Assign to Chao for this issue, the previous change was made by him.

> Pass the wrong parameter to addResource function, kylin can not load the configuration file hbase.hdfs.xml .
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: KYLIN-3709
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3709
>             Project: Kylin
>          Issue Type: Bug
>          Components: Job Engine
>    Affects Versions: v2.5.1, v2.5.2
>            Reporter: Hongtao He
>            Assignee: Chao Long
>            Priority: Critical
>         Attachments: method-1-Pass-the-wrong-parameter-to-addResource-function-kyl.patch, method-2-Pass-the-wrong-parameter-to-addResource-function-kyl.patch
>
>
> When calling Configuration.addResource, KYLIN-3648 use a Path as the parameter instead of a string in Kylin's HBaseConnection.
> {code:java}
> String hdfsConfigFile = KylinConfig.getInstanceFromEnv().getHBaseClusterHDFSConfigFile();
> if (hdfsConfigFile == null || hdfsConfigFile.isEmpty()) {
>     return;
> }
> Configuration hdfsConf = new Configuration(false);
> hdfsConf.addResource(new Path(hdfsConfigFile));
> {code}
> Use a Path as the parameter of Configuration.addResource is better. Unfortunately,  the parameter which passed to the addResource function is wrong. The addResource function only accepts absolute paths, but the parameter is just a filename. For example, the value of hdfsConfigFile is "hbase.hdfs.xml", so addResource function will not work . The end result is that kylin can not load the hbase configuration file hbase.hdfs.xml .
> There are two ways to fix this bug, and I think method 1 is better.
> Method-1.revert the code
> {code:java}
> String hdfsConfigFile = KylinConfig.getInstanceFromEnv().getHBaseClusterHDFSConfigFile();
> if (hdfsConfigFile == null || hdfsConfigFile.isEmpty()) {
>     return;
> }
> Configuration hdfsConf = new Configuration(false);
> hdfsConf.addResource(hdfsConfigFile);{code}
> Method-2.Get the absolute path of the configuration file
> {code:java}
> String hdfsConfigFile = KylinConfig.getInstanceFromEnv().getHBaseClusterHDFSConfigFile();
> if (hdfsConfigFile == null || hdfsConfigFile.isEmpty()) {
>     return;
> }
> Configuration hdfsConf = new Configuration(false);
> String hbaseHdfsConfigPath = System.getProperty("user.dir") + "/../conf/" + hdfsConfigFile;
> hdfsConf.addResource(new Path(hbaseHdfsConfigPath));
> {code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)