Skip to content
Browse files

Initial attempts at custom SDF output formats

  • Loading branch information...
1 parent afa1990 commit e1d78ebcfa3c4a5277205f2fd7db0112fbe7a10d @rajarshi committed May 6, 2009
View
16 CDKPersonal/rghadoop/src/net/rguha/dc/io/SDFOutputFormat.java
@@ -0,0 +1,16 @@
+package net.rguha.dc.io;
+
+import org.apache.hadoop.io.LongWritable;
+import org.apache.hadoop.io.Text;
+import org.apache.hadoop.mapreduce.RecordWriter;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+import org.apache.hadoop.mapreduce.lib.output.TextOutputFormat;
+
+import java.io.IOException;
+
+
+public class SDFOutputFormat extends TextOutputFormat {
+ public RecordWriter getRecordWriter(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
+ return new SDFRecordWriter<LongWritable,Text>();
+ }
+}
View
20 CDKPersonal/rghadoop/src/net/rguha/dc/io/SDFRecordWriter.java
@@ -0,0 +1,20 @@
+package net.rguha.dc.io;
+
+import org.apache.hadoop.mapreduce.RecordWriter;
+import org.apache.hadoop.mapreduce.TaskAttemptContext;
+
+import java.io.IOException;
+
+public class SDFRecordWriter<LongWritable,Text> extends RecordWriter<LongWritable, Text> {
+ public SDFRecordWriter() {
+ }
+
+ public void write(LongWritable text, Text text1) throws IOException {
+// TextOutputFormat.LineRecordWriter lrw;
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void close(TaskAttemptContext taskAttemptContext) throws IOException, InterruptedException {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+}

0 comments on commit e1d78eb

Please sign in to comment.
Something went wrong with that request. Please try again.