Hi, I'm not sure what kind of constraints you are under, specifically why
you wouldn't serve these files up on a (rack local) web server, and mitigate
the overhead of the http request by using more slave nodes. You could skip
the file load step completely that way.
But if you do need to copy files up to HDFS, I would recommend using
distcp: http://hadoop.apache.org/core/docs/current/distcp.html, it's faster
than a straight up hadoop -copyFromLocal. You do have to be specific about
the file systems you are copying from/to, i.e. specify local as file:// and
hdfs as hdfs://. This link showing how to use distcp to copy to s3 gives
some examples of copying between filesystems:
http://wiki.apache.org/hadoop/AmazonS3

-- Arun
On Wed, May 6, 2009 at 11:52 AM, Alan Drew <[email protected]> wrote:

>
> Hi,
>
> I have a question about how to efficiently access multiple files during the
> Reduce phase.  The reducer gets a <key, list of values> where each key is a
> different file and the value represents where to look in the file.  The
> files are actually .png images.
>
> I have tried using the DistributedCache, where I copy all the files to the
> HDFS and then during the Reduce phase, I look in
>
> Path [] localFiles = DistributedCache.getLocalCacheFiles(configuration);
>
> and then I pick the appropriate path of the file I need from localFiles and
> process it.  However, I'm noticing that it's taking a long time to copy the
> files to the HDFS.  I'm wondering if it'd be better to leave the files on
> the local file system and then during the Reduce phase, open the file
> directly.  I don't know if this is possible though.
>
> In general, I'm wondering how to efficiently access multiple files during
> either the Map/Reduce phase?  Is DistributedCache the best way?
>
> Thanks.
> --
> View this message in context:
> http://www.nabble.com/accessing-multiple-files-in-Reducer-tp23413154p23413154.html
> Sent from the Hadoop core-user mailing list archive at Nabble.com.
>
>

Reply via email to