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:20:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=16709649#comment-16709649 ] 

Shaofeng SHI commented on KYLIN-3709:
-------------------------------------

Hi Hongtao, we only merged KYLIN-3648 on master branch; Kylin 2.5.x doesn't have the code change of KYLIN-3648 , so 2.5.0 to 2.5.2 not affected, you can double check it.

 

If "kylin.storage.hbase.cluster-hdfs-config-file" be set to an absolute path, is there such problem?

> 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: Shaofeng SHI
>            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)