for (String codec: new String [] {"none", "gz"} ) {
System.err.println("Testing RecordWriter/Reader with codec: "
+ codec);
try {
TFileRecordWriter writer = new TFileRecordWriter(basicTFile,
codec, conf);
Tuple tuple = TupleFactory.getInstance().newTuple(1);
int LOOP_SIZE = 25000;
for( int i=0; i <= LOOP_SIZE; i++) {
String key = String.format("%010d",i);
tuple.set(0,key);
writer.write(null, tuple);
}
writer.close(null);
int size = (int) tFile.length();
FileSplit split = new FileSplit(basicTFile, 0, size, null);
TFileRecordReader reader = new TFileRecordReader();
reader.initialize(split,
HadoopShims.createTaskAttemptContext(