@@ -0,0 +1,1391 @@
+import java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.net.URI;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.fs.FileSystem;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.apache.hadoop.io.IntWritable;%0Aimport org.apache.hadoop.io.IOUtils;%0Aimport org.apache.hadoop.io.SequenceFile;%0Aimport org.apache.hadoop.io.Text;%0A%0Apublic class Txt2SeqConverter%0A%7B%0A%09public static void main(String%5B%5D args)%0A%09%7B%0A%09  %09FileSystem fs = null;%0A%09  %09String seqFileName = args%5B1%5D;%0A%09%09Configuration conf = new Configuration();%0A%09%09try %7B%0A%09%09  %09fs = FileSystem.get(URI.create(seqFileName), conf);%0A%09%09%7D catch (IOException e)%0A%09%09%7B%0A%09%09%09System.out.println(%22ERROR: %22 + e.getMessage()); %0A%09%09%7D%0A%09%09  %0A%09%09Path path = new Path(seqFileName);%0A%0A%09%09IntWritable key = new IntWritable();%0A%09%09Text value = new Text();%0A%09%09SequenceFile.Writer writer = null;%0A%09%09try%0A%09%09%7B%0A%09%09  %09writer = SequenceFile.createWriter(fs, conf, path, IntWritable.class, Text.class);%0A%09%09%09BufferedReader br = new BufferedReader(new FileReader(args%5B0%5D));%0A%0A%09%09%09int transactionID = 1;%0A%09%09%09String transaction = null;%0A%09%09%09while ((transaction = br.readLine()) != null)%0A%09%09%09%7B%0A%09%09%09  key.set(transactionID);%0A%09%09%09  value.set(transaction);%0A%09%09%09  writer.append(key, value);%0A%0A%09%09%09  transactionID++;%0A%09%09%09%7D%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09System.out.println(%22ERROR: %22 + e.getMessage()); %0A%09%09%7D finally %7B%0A%09%09  %09IOUtils.closeStream(writer);%0A%09%09%7D%0A%09%7D%0A%7D%0A%0A

Add Txt2SeqConverter, which converts from plain text to SequenceFile. The key used in the SequenceFile is the line number (starting from 1).