You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by 谭军 <ta...@163.com> on 2011/09/23 15:01:09 UTC

The method addCacheFIle(URI) is undefined for the type Job

 Hi,
I encountered an error that I cannot understand.

Configuration conf = new Configuration();
Job job = new Job(conf, "job1");
job.addCacheFile(new URI(args[0]));

Why did it report "The method addCacheFile(URI) is undefined for the type Job"?
Thanks!

--


Regards!

Jun Tan

Re: Re: Re: Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by Joey Echeverria <jo...@cloudera.com>.
Doesn't look like it to me:

http://hadoop.apache.org/common/docs/r0.20.2/api/org/apache/hadoop/mapreduce/Job.html

2011/9/23 谭军 <ta...@163.com>:
> Joey Echeverria,
> Yes, that works.
> I thought job.addCacheFile(new URI(args[0])); could run on hadoop-0.20.2.
> Because hadoop-0.20.2 could run context object.
> Thanks!
>
> --
>
> Regards!
>
> Jun Tan
>
> At 2011-09-24 11:54:42,"Joey Echeverria" <jo...@cloudera.com> wrote:
>>I think the API call you're looking for is
>>DistributedCache.addCacheFile(URI, Configuration) [1]
>>
>>-Joey
>>
>>[1] http://hadoop.apache.org/common/docs/r0.20.2/api/org/apache/hadoop/filecache/DistributedCache.html#addCacheFile(java.net.URI,
>>org.apache.hadoop.conf.Configuration)
>>
>>2011/9/23 谭军 <ta...@163.com>:
>>> Hi Joey Echeverria,
>>> My hadoop version is 0.20.2
>>>
>>> --
>>>
>>> Regards!
>>>
>>> Jun Tan
>>>
>>> 在 2011-09-24 11:36:08,"Joey Echeverria" <jo...@cloudera.com> 写道:
>>>>Which version of Hadoop are you using?
>>>>
>>>>2011/9/23 谭军 <ta...@163.com>:
>>>>> Harsh,
>>>>> It is java.net.URI that is imported.
>>>>>
>>>>> --
>>>>>
>>>>> Regards!
>>>>>
>>>>> Jun Tan
>>>>>
>>>>> At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>>>>>>Jun,
>>>>>>
>>>>>>Common cause is that your URI class is not the right import.
>>>>>>
>>>>>>It must be java.net.URI and not any other class. Fix this and your
>>>>>>problem would go away.
>>>>>>
>>>>>>2011/9/23 谭军 <ta...@163.com>:
>>>>>>>  Hi,
>>>>>>> I encountered an error that I cannot understand.
>>>>>>>
>>>>>>> Configuration conf = new Configuration();
>>>>>>> Job job = new Job(conf, "job1");
>>>>>>> job.addCacheFile(new URI(args[0]));
>>>>>>>
>>>>>>> Why did it report "The method addCacheFile(URI) is undefined for the type
>>>>>>> Job"?
>>>>>>> Thanks!
>>>>>>> --
>>>>>>>
>>>>>>> Regards!
>>>>>>>
>>>>>>> Jun Tan
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>--
>>>>>>Harsh J
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>Joseph Echeverria
>>>>Cloudera, Inc.
>>>>443.305.9434
>>>
>>>
>>>
>>
>>
>>
>>--
>>Joseph Echeverria
>>Cloudera, Inc.
>>443.305.9434
>
>
>



-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

Re:Re: Re: Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by 谭军 <ta...@163.com>.
Joey Echeverria,
Yes, that works.
I thought job.addCacheFile(new URI(args[0])); could run on hadoop-0.20.2.
Because hadoop-0.20.2 could run context object.
Thanks!


--


Regards!

Jun Tan




At 2011-09-24 11:54:42,"Joey Echeverria" <jo...@cloudera.com> wrote:
>I think the API call you're looking for is
>DistributedCache.addCacheFile(URI, Configuration) [1]
>
>-Joey
>
>[1] http://hadoop.apache.org/common/docs/r0.20.2/api/org/apache/hadoop/filecache/DistributedCache.html#addCacheFile(java.net.URI,
>org.apache.hadoop.conf.Configuration)
>
>2011/9/23 谭军 <ta...@163.com>:
>> Hi Joey Echeverria,
>> My hadoop version is 0.20.2
>>
>> --
>>
>> Regards!
>>
>> Jun Tan
>>
>> 在 2011-09-24 11:36:08,"Joey Echeverria" <jo...@cloudera.com> 写道:
>>>Which version of Hadoop are you using?
>>>
>>>2011/9/23 谭军 <ta...@163.com>:
>>>> Harsh,
>>>> It is java.net.URI that is imported.
>>>>
>>>> --
>>>>
>>>> Regards!
>>>>
>>>> Jun Tan
>>>>
>>>> At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>>>>>Jun,
>>>>>
>>>>>Common cause is that your URI class is not the right import.
>>>>>
>>>>>It must be java.net.URI and not any other class. Fix this and your
>>>>>problem would go away.
>>>>>
>>>>>2011/9/23 谭军 <ta...@163.com>:
>>>>>>  Hi,
>>>>>> I encountered an error that I cannot understand.
>>>>>>
>>>>>> Configuration conf = new Configuration();
>>>>>> Job job = new Job(conf, "job1");
>>>>>> job.addCacheFile(new URI(args[0]));
>>>>>>
>>>>>> Why did it report "The method addCacheFile(URI) is undefined for the type
>>>>>> Job"?
>>>>>> Thanks!
>>>>>> --
>>>>>>
>>>>>> Regards!
>>>>>>
>>>>>> Jun Tan
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>Harsh J
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>--
>>>Joseph Echeverria
>>>Cloudera, Inc.
>>>443.305.9434
>>
>>
>>
>
>
>
>-- 
>Joseph Echeverria
>Cloudera, Inc.
>443.305.9434

Re: Re: Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by Joey Echeverria <jo...@cloudera.com>.
I think the API call you're looking for is
DistributedCache.addCacheFile(URI, Configuration) [1]

-Joey

[1] http://hadoop.apache.org/common/docs/r0.20.2/api/org/apache/hadoop/filecache/DistributedCache.html#addCacheFile(java.net.URI,
org.apache.hadoop.conf.Configuration)

2011/9/23 谭军 <ta...@163.com>:
> Hi Joey Echeverria,
> My hadoop version is 0.20.2
>
> --
>
> Regards!
>
> Jun Tan
>
> 在 2011-09-24 11:36:08,"Joey Echeverria" <jo...@cloudera.com> 写道:
>>Which version of Hadoop are you using?
>>
>>2011/9/23 谭军 <ta...@163.com>:
>>> Harsh,
>>> It is java.net.URI that is imported.
>>>
>>> --
>>>
>>> Regards!
>>>
>>> Jun Tan
>>>
>>> At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>>>>Jun,
>>>>
>>>>Common cause is that your URI class is not the right import.
>>>>
>>>>It must be java.net.URI and not any other class. Fix this and your
>>>>problem would go away.
>>>>
>>>>2011/9/23 谭军 <ta...@163.com>:
>>>>>  Hi,
>>>>> I encountered an error that I cannot understand.
>>>>>
>>>>> Configuration conf = new Configuration();
>>>>> Job job = new Job(conf, "job1");
>>>>> job.addCacheFile(new URI(args[0]));
>>>>>
>>>>> Why did it report "The method addCacheFile(URI) is undefined for the type
>>>>> Job"?
>>>>> Thanks!
>>>>> --
>>>>>
>>>>> Regards!
>>>>>
>>>>> Jun Tan
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>Harsh J
>>>
>>>
>>>
>>
>>
>>
>>--
>>Joseph Echeverria
>>Cloudera, Inc.
>>443.305.9434
>
>
>



-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

Re:Re: Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by 谭军 <ta...@163.com>.
Hi Joey Echeverria,
My hadoop version is 0.20.2


--


Regards!

Jun Tan




在 2011-09-24 11:36:08,"Joey Echeverria" <jo...@cloudera.com> 写道:
>Which version of Hadoop are you using?
>
>2011/9/23 谭军 <ta...@163.com>:
>> Harsh,
>> It is java.net.URI that is imported.
>>
>> --
>>
>> Regards!
>>
>> Jun Tan
>>
>> At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>>>Jun,
>>>
>>>Common cause is that your URI class is not the right import.
>>>
>>>It must be java.net.URI and not any other class. Fix this and your
>>>problem would go away.
>>>
>>>2011/9/23 谭军 <ta...@163.com>:
>>>>  Hi,
>>>> I encountered an error that I cannot understand.
>>>>
>>>> Configuration conf = new Configuration();
>>>> Job job = new Job(conf, "job1");
>>>> job.addCacheFile(new URI(args[0]));
>>>>
>>>> Why did it report "The method addCacheFile(URI) is undefined for the type
>>>> Job"?
>>>> Thanks!
>>>> --
>>>>
>>>> Regards!
>>>>
>>>> Jun Tan
>>>>
>>>>
>>>
>>>
>>>
>>>--
>>>Harsh J
>>
>>
>>
>
>
>
>-- 
>Joseph Echeverria
>Cloudera, Inc.
>443.305.9434

Re: Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by Joey Echeverria <jo...@cloudera.com>.
Which version of Hadoop are you using?

2011/9/23 谭军 <ta...@163.com>:
> Harsh,
> It is java.net.URI that is imported.
>
> --
>
> Regards!
>
> Jun Tan
>
> At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>>Jun,
>>
>>Common cause is that your URI class is not the right import.
>>
>>It must be java.net.URI and not any other class. Fix this and your
>>problem would go away.
>>
>>2011/9/23 谭军 <ta...@163.com>:
>>>  Hi,
>>> I encountered an error that I cannot understand.
>>>
>>> Configuration conf = new Configuration();
>>> Job job = new Job(conf, "job1");
>>> job.addCacheFile(new URI(args[0]));
>>>
>>> Why did it report "The method addCacheFile(URI) is undefined for the type
>>> Job"?
>>> Thanks!
>>> --
>>>
>>> Regards!
>>>
>>> Jun Tan
>>>
>>>
>>
>>
>>
>>--
>>Harsh J
>
>
>



-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

Re:Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by 谭军 <ta...@163.com>.
Harsh,
It is java.net.URI that is imported.


--


Regards!

Jun Tan




At 2011-09-24 00:52:14,"Harsh J" <ha...@cloudera.com> wrote:
>Jun,
>
>Common cause is that your URI class is not the right import.
>
>It must be java.net.URI and not any other class. Fix this and your
>problem would go away.
>
>2011/9/23 谭军 <ta...@163.com>:
>>  Hi,
>> I encountered an error that I cannot understand.
>>
>> Configuration conf = new Configuration();
>> Job job = new Job(conf, "job1");
>> job.addCacheFile(new URI(args[0]));
>>
>> Why did it report "The method addCacheFile(URI) is undefined for the type
>> Job"?
>> Thanks!
>> --
>>
>> Regards!
>>
>> Jun Tan
>>
>>
>
>
>
>-- 
>Harsh J

Re: The method addCacheFIle(URI) is undefined for the type Job

Posted by Harsh J <ha...@cloudera.com>.
Jun,

Common cause is that your URI class is not the right import.

It must be java.net.URI and not any other class. Fix this and your
problem would go away.

2011/9/23 谭军 <ta...@163.com>:
>  Hi,
> I encountered an error that I cannot understand.
>
> Configuration conf = new Configuration();
> Job job = new Job(conf, "job1");
> job.addCacheFile(new URI(args[0]));
>
> Why did it report "The method addCacheFile(URI) is undefined for the type
> Job"?
> Thanks!
> --
>
> Regards!
>
> Jun Tan
>
>



-- 
Harsh J