Sahil Takiar created HDFS-14301: ----------------------------------- Summary: libhdfs should expose a method to get conf parameters from a hdfsFS instance Key: HDFS-14301 URL: https://issues.apache.org/jira/browse/HDFS-14301 Project: Hadoop HDFS Issue Type: Improvement Components: hdfs-client, libhdfs, native Reporter: Sahil Takiar Assignee: Sahil Takiar
libhdfs currently exposes a few methods for getting the values of a configuration parameters: {{hdfsConfGetStr}} and {{hdfsConfGetInt}}. The issue is that in {{hdfs.c}} the implementation of these methods simply calls {{new Configuration()}} and fetches values using {{get}}. The issue is that calling {{new Configuration}} simply loads the current {{hdfs-site.xml}}, {{core-site.xml}}, etc. which does not take into account the scenario where the default configuration has been modified for specific filesystem instances. For example, the {{hdfsBuilder}} exposes a {{hdfsBuilderConfSetStr}} method that allows setting non-default configuration parameters. This could lead to issues such as: {code:java} struct hdfsBuilder *bld; bld = hdfsNewBuilder(); hdfsBuilderSetForceNewInstance(bld); hdfsBuilderConfSetStr(bld, "hello", "world"); hdfs = hdfsBuilderConnect(bld); char* value = NULL; hdfsConfGetStr("hello", &value); // Value is NULL! {code} This JIRA proposes adding a new set of methods to libhdfs that take in a {{hdfsFS}} object and get the value of the key from the {{hdfsFS}} object rather than using {{new Configuration}}. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org