Last change
on this file since 137 was
20,
checked in by waue, 16 years ago
|
將改完的 hadoop 0.17版package 放來備份
目前繼續開發 hadoop 0.16 + hbase 1.3
|
File size:
924 bytes
|
Rev | Line | |
---|
[20] | 1 | package tw.org.nchc.code; |
---|
| 2 | import java.io.IOException; |
---|
| 3 | |
---|
| 4 | import org.apache.hadoop.fs.FileStatus; |
---|
| 5 | import org.apache.hadoop.fs.FileSystem; |
---|
| 6 | import org.apache.hadoop.fs.Path; |
---|
| 7 | import org.apache.hadoop.mapred.FileInputFormat; |
---|
| 8 | import org.apache.hadoop.mapred.FileOutputFormat; |
---|
| 9 | import org.apache.hadoop.mapred.JobConf; |
---|
| 10 | |
---|
| 11 | public class Convert |
---|
| 12 | { |
---|
| 13 | static public Path[] listPaths(FileSystem fsm,Path path) throws IOException |
---|
| 14 | { |
---|
| 15 | FileStatus[] fss = fsm.listStatus(path); |
---|
| 16 | int length = fss.length; |
---|
| 17 | Path[] pi = new Path[length]; |
---|
| 18 | for (int i=0 ; i< length; i++) |
---|
| 19 | { |
---|
| 20 | pi[i] = fss[i].getPath(); |
---|
| 21 | } |
---|
| 22 | return pi; |
---|
| 23 | } |
---|
| 24 | static public void setInputPath(JobConf conf, Path path){ |
---|
| 25 | FileInputFormat.setInputPaths(conf, path); |
---|
| 26 | } |
---|
| 27 | static public void addInputPath(JobConf conf, Path path){ |
---|
| 28 | FileInputFormat.addInputPath(conf, path); |
---|
| 29 | } |
---|
| 30 | static public void setOutputPath(JobConf conf,Path path){ |
---|
| 31 | FileOutputFormat.setOutputPath(conf, path); |
---|
| 32 | } |
---|
| 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.