Return-Path: X-Original-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-mapreduce-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3789BD52F for ; Thu, 6 Dec 2012 21:30:30 +0000 (UTC) Received: (qmail 59958 invoked by uid 500); 6 Dec 2012 21:30:25 -0000 Delivered-To: apmail-hadoop-mapreduce-user-archive@hadoop.apache.org Received: (qmail 59868 invoked by uid 500); 6 Dec 2012 21:30:25 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 59861 invoked by uid 99); 6 Dec 2012 21:30:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 21:30:25 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of peter.cogan@gmail.com designates 209.85.216.176 as permitted sender) Received: from [209.85.216.176] (HELO mail-qc0-f176.google.com) (209.85.216.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 06 Dec 2012 21:30:18 +0000 Received: by mail-qc0-f176.google.com with SMTP id n41so3986302qco.35 for ; Thu, 06 Dec 2012 13:29:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MfAzHicCQFI3BkipUTgrwrUJzdrQDh4mKbrz5URgxCQ=; b=Vye5T84r4JZodkWC3Og6A3WtoT7Fj+/FVALO9ZPSuSGPyvNrvWmw6t1EIzPnVIWCxG /3SVHfPbJd0PZv5s4jkRvI008O0XCG/my2l5mSO9gDuU9bBy4Pj2weq9YZH7HrNoLiUL InC9DT9TmY+/3Z/PseEupykWjWLpiUK2ifKZldVmUknXGEEqtj4HPA2qba+CIK9HJ39b zhp57sM3AQs+ki/SemEm1CuVqWJW5Ie/rJIVY5jiunDqZ8rPyBQrWBPLwKayJ4/T0S52 pPy9o2GB2tgVsYlRFKn5knwkFqA1daXTcx/Ed9z7uojNDdnjjegM7NnVXjusRZGiHYky Wang== MIME-Version: 1.0 Received: by 10.224.27.199 with SMTP id j7mr5342004qac.86.1354829397499; Thu, 06 Dec 2012 13:29:57 -0800 (PST) Received: by 10.49.108.234 with HTTP; Thu, 6 Dec 2012 13:29:57 -0800 (PST) In-Reply-To: References: Date: Thu, 6 Dec 2012 21:29:57 +0000 Message-ID: Subject: Re: Problem using distributed cache From: Peter Cogan To: user@hadoop.apache.org Content-Type: multipart/alternative; boundary=14dae9ccdfe4f81fdb04d035cc13 X-Virus-Checked: Checked by ClamAV on apache.org --14dae9ccdfe4f81fdb04d035cc13 Content-Type: text/plain; charset=ISO-8859-1 Hi, It's an instance created at the start of the program like this: public static void main(String[] args) throws Exception { Configuration conf = new Configuration(); Job job = new Job(conf, "wordcount"); DistributedCache.addCacheFile(new URI("/user/peter/cacheFile/testCache1"), conf); On Thu, Dec 6, 2012 at 5:02 PM, Harsh J wrote: > What is your conf object there? Is it job.getConfiguration() or an > independent instance? > > On Thu, Dec 6, 2012 at 10:29 PM, Peter Cogan > wrote: > > Hi , > > > > I want to use the distributed cache to allow my mappers to access data. > In > > main, I'm using the command > > > > DistributedCache.addCacheFile(new > URI("/user/peter/cacheFile/testCache1"), > > conf); > > > > Where /user/peter/cacheFile/testCache1 is a file that exists in hdfs > > > > Then, my setup function looks like this: > > > > public void setup(Context context) throws IOException, > InterruptedException{ > > Configuration conf = context.getConfiguration(); > > Path[] localFiles = DistributedCache.getLocalCacheFiles(conf); > > //etc > > } > > > > However, this localFiles array is always null. > > > > I was initially running on a single-host cluster for testing, but I read > > that this will prevent the distributed cache from working. I tried with a > > pseudo-distributed, but that didn't work either > > > > I'm using hadoop 1.0.3 > > > > thanks Peter > > > > > > > > -- > Harsh J > --14dae9ccdfe4f81fdb04d035cc13 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

It's an instance created at the start of the pro= gram like this:

public= static void main(String[] args) throws Exception {

Configuration conf =3D new Configuration();

<= br>

Job job =3D new Job(conf, "w= ordcount");

<= br>

<= br>

DistributedCache.addCacheFile(new URI("/user/peter/cacheFile/testCache1"), conf);

<= br>

<= span class=3D"" style=3D"white-space:pre">

<= span class=3D"" style=3D"white-space:pre">



On Thu, Dec 6, 2012 at 5:02= PM, Harsh J <harsh@cloudera.com> wrote:
What is your conf object there? Is it job.ge= tConfiguration() or an
independent instance?

On Thu, Dec 6, 2012 at 10:29 PM, Peter Cogan <peter.cogan@gmail.com> wrote:
> Hi ,
>
> I want to use the distributed cache to allow my mappers to access data= . In
> main, I'm using the command
>
> DistributedCache.addCacheFile(new URI("/user/peter/cacheFile/test= Cache1"),
> conf);
>
> Where /user/peter/cacheFile/testCache1 is a file that exists in hdfs >
> Then, my setup function looks like this:
>
> public void setup(Context context) throws IOException, InterruptedExce= ption{
> =A0 =A0 Configuration conf =3D context.getConfiguration();
> =A0 =A0 Path[] localFiles =3D DistributedCache.getLocalCacheFiles(conf= );
> =A0 =A0 //etc
> }
>
> However, this localFiles array is always null.
>
> I was initially running on a single-host cluster for testing, but I re= ad
> that this will prevent the distributed cache from working. I tried wit= h a
> pseudo-distributed, but that didn't work either
>
> I'm using hadoop 1.0.3
>
> thanks Peter
>
>



--
Harsh J

--14dae9ccdfe4f81fdb04d035cc13--