Changeset 25 for sample/hadoop-0.16/tw/org/nchc/util
- Timestamp:
- Jul 3, 2008, 4:45:54 PM (16 years ago)
- Location:
- sample/hadoop-0.16/tw/org/nchc/util
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/hadoop-0.16/tw/org/nchc/util/SequenceFileProcessor.java
r21 r25 1 /** 2 * Program: BuildHTable.java 3 * Editor: Waue Chen 4 * From : NCHC. Taiwn 5 * Last Update Date: 07/02/2008 6 * Upgrade to 0.17 7 * Re-code from : Cloud9: A MapReduce Library for Hadoop 1 /* 2 * Cloud9: A MapReduce Library for Hadoop 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); you 5 * may not use this file except in compliance with the License. You may 6 * obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 13 * implied. See the License for the specific language governing 14 * permissions and limitations under the License. 8 15 */ 9 10 16 11 17 package tw.org.nchc.util; … … 13 19 import java.io.IOException; 14 20 15 import org.apache.hadoop.fs.FileStatus;16 21 import org.apache.hadoop.fs.FileSystem; 17 22 import org.apache.hadoop.fs.Path; … … 22 27 23 28 /** 24 * Upgrade from hadoop 0.16 to 0.1725 29 * <p> 26 30 * Harness for processing one or more {@link SequenceFile}s within a single … … 115 119 private void run() throws IOException { 116 120 if (!FileSystem.get(conf).isFile(mPath)) { 117 Path[] pa = new Path[] { mPath }; 118 Path p; 119 // hadoop 0.17 -> listStatus(); 120 FileStatus[] fi = FileSystem.get(conf).listStatus(pa); 121 for (int i =0 ; i<fi.length ; i++) { 122 p = fi[i].getPath(); 121 for (Path p : FileSystem.get(conf).listPaths(new Path[] { mPath })) { 123 122 // System.out.println("Applying to " + p); 124 123 applyToFile(p);
Note: See TracChangeset
for help on using the changeset viewer.