You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hadoop.apache.org by Geoffry Roberts <th...@gmail.com> on 2018/08/10 18:42:10 UTC
I could swear this worked before
I am stuck.
It is something simple and I am sure the worked with older Hadoop versions.
Currently, I am running Hadoop 2.9.1.
Question: Why am I getting a null? Clearly, the value has not been set,
but why?
Driver code:
...
Configuration conf = new Configuration;
Job job = Job.getInstance(conf, "somejobname");
conf.set("ZOOKEEPER_URI", "http://localhost:2181");
...
Mapper code:
...
protected void setup(Context ctx) throws IOException, InterruptedException {
Configuration conf = ctx.getConfiguration();
String zkURI = conf.get("ZOOKEEPER_URI");
// Here's the problem: zkURI is null.
}
System.out.println(ctx.getJobName()); // prints "somejobname" as expected.
...
Thanks all
--
There are ways and there are ways,
Geoffry Roberts