Ignore:
Timestamp:
Jul 3, 2008, 4:45:54 PM (16 years ago)
Author:
waue
Message:

downgrade from 0.17 to 0.16
test for work -> not yet

File:
1 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.
    815 */
    9 
    1016
    1117package tw.org.nchc.util;
     
    1319import java.io.IOException;
    1420
    15 import org.apache.hadoop.fs.FileStatus;
    1621import org.apache.hadoop.fs.FileSystem;
    1722import org.apache.hadoop.fs.Path;
     
    2227
    2328/**
    24  * Upgrade from hadoop 0.16 to 0.17
    2529 * <p>
    2630 * Harness for processing one or more {@link SequenceFile}s within a single
     
    115119  private void run() throws IOException {
    116120    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 })) {
    123122        // System.out.println("Applying to " + p);
    124123        applyToFile(p);
Note: See TracChangeset for help on using the changeset viewer.