views:

75

answers:

2

Hi,

I am trying to add multiple files to hadoop distributed cache. Actually I don't know the file names. They will be named like part-0000*. Can someone tell me how to do that?

Thanks Bala

A: 

You can use either the hadoop -put or -copyFromLocal command:

hadoop fs -copyFromLocal /home/hadoop/outgoing/* /your/hadoop/dir
Matthew Hegarty
I want to do it programmatically...
Algorist
You could either write bash scripts and call them from Java, or look at the HDFS Java API - see "Using HDFS Programmatically" - http://developer.yahoo.com/hadoop/tutorial/module2.html
Matthew Hegarty
A: 

Nothing prevents you from programmatically getting the list of files if they all are in one directory and the adding them one by one, right? Or is your case different?

Dmytro Molkov