package com.jasongj.spark.model;

import com.jasongj.spark.reader.BucketReaderIterator;
import com.jasongj.spark.reader.ParquetBucketReaderIterator;
import com.jasongj.spark.reader.TextBucketReaderIterator;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

/**
 * Created by Jason Guo (jason.guo.vip@gmail.com)
 */
public enum DataType {
    TEXT(TextBucketReaderIterator.class, Arrays.asList("org.apache.hadoop.mapred.TextInputFormat", "org.apache.hadoop.mapreduce.lib.input.TextInputFormat")),
    PARQUET(ParquetBucketReaderIterator.class, Arrays.asList("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat", "org.apache.parquet.hadoop.ParquetInputFormat"));

    @Getter
    private Class<? extends BucketReaderIterator> readClass;
    @Getter private List<String> inputFormats;

    DataType(Class<? extends BucketReaderIterator> readClass, List<String> inputFormats) {
        this.readClass = readClass;
        this.inputFormats = inputFormats;
    }
}
@@ -196,24 +196,170 @@
 erIterator;%0A
+import com.jasongj.spark.writer.ParquetTupleWriter;%0Aimport com.jasongj.spark.writer.TextTupleWriter;%0Aimport com.jasongj.spark.writer.TupleWriter;%0A
 import lombo
@@ -531,32 +531,55 @@
 rIterator.class,
+ TextTupleWriter.class,
  Arrays.asList(%22
@@ -612,32 +612,44 @@
 extInputFormat%22,
+%0A           
  %22org.apache.had
@@ -688,16 +688,132 @@
 tFormat%22
+, %22org.apache.hadoop.mapred.TextOutputFormat%22,%0A            %22org.apache.hadoop.mapreduce.lib.output.TextOutputFormat%22
 )),%0A    
@@ -846,32 +846,58 @@
 rIterator.class,
+ ParquetTupleWriter.class,
  Arrays.asList(%22
@@ -951,32 +951,44 @@
 uetInputFormat%22,
+%0A           
  %22org.apache.par
@@ -1018,16 +1018,143 @@
 tFormat%22
+, %22org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat%22,%0A            %22org.apache.parquet.hadoop.ParquetOutputFormat%22
 ));%0A%0A   
@@ -1212,24 +1212,92 @@
 erator%3E read
+erClass;%0A    @Getter%0A    private Class%3C? extends TupleWriter%3E writer
 Class;%0A    @
@@ -1390,24 +1390,68 @@
 erator%3E read
+erClass, Class%3C? extends TupleWriter%3E writer
 Class, List%3C
@@ -1487,24 +1487,26 @@
    this.read
+er
 Class = read
@@ -1505,16 +1505,58 @@
 s = read
+erClass;%0A        this.writerClass = writer
 Class;%0A 

Add writer class for each DataType