Created
February 11, 2010 00:32
-
-
Save toddlipcon/301034 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.apache.hadoop.mapred; | |
import java.io.*; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.io.BytesWritable; | |
import org.apache.hadoop.util.ReflectionUtils; | |
class Test { | |
public static void main(String []args) throws Exception { | |
Configuration conf = new Configuration(); | |
DataInput in = new DataInputStream(new FileInputStream(args[0])); | |
JobClient.RawSplit raws[] = JobClient.readSplitFile(in); | |
for (JobClient.RawSplit raw : raws) { | |
InputSplit is = (InputSplit)ReflectionUtils.newInstance( | |
Class.forName(raw.getClassName()), conf); | |
BytesWritable bw = raw.getBytes(); | |
is.readFields(new DataInputStream( | |
new ByteArrayInputStream(bw.getBytes(), 0, bw.getLength()))); | |
System.out.println(is); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment