diff --git a/MANIFEST.txt b/MANIFEST.txt new file mode 100644 index 0000000..efbeea9 --- /dev/null +++ b/MANIFEST.txt @@ -0,0 +1 @@ +Main-Class: com.github.sakserv.sequencefile.SequenceFileReader \ No newline at end of file diff --git a/pom.xml b/pom.xml index c694b34..62ec680 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,11 @@ + + log4j + log4j + 1.2.17 + org.slf4j slf4j-api @@ -149,7 +154,21 @@ - + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + + java + + + + + com.github.sakserv.sequencefile.SequenceFileReader + + org.apache.maven.plugins maven-shade-plugin diff --git a/src/main/java/com/github/sakserv/sequencefile/SequenceFileReader.java b/src/main/java/com/github/sakserv/sequencefile/SequenceFileReader.java index 8f28cf5..5d23cae 100644 --- a/src/main/java/com/github/sakserv/sequencefile/SequenceFileReader.java +++ b/src/main/java/com/github/sakserv/sequencefile/SequenceFileReader.java @@ -16,19 +16,13 @@ package com.github.sakserv.sequencefile; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.io.IntWritable; import org.apache.hadoop.io.SequenceFile; import org.apache.hadoop.io.Text; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import java.io.IOException; public class SequenceFileReader { - // Logger - private static final Logger LOG = LoggerFactory.getLogger(SequenceFileReader.class); - public static void main(String[] args) { String inputFile = args[0]; @@ -42,15 +36,16 @@ public class SequenceFileReader { SequenceFile.Reader.file(seqFilePath)); Text key = new Text(); - IntWritable val = new IntWritable(); + Text val = new Text(); while (reader.next(key, val)) { - LOG.info("Sequence File Data: Key: " + key + "\tValue: " + val); + //LOG.info(val); + System.out.println(val); } reader.close(); } catch(IOException e) { - LOG.error("ERROR: Could not load hadoop configuration"); + System.err.println("ERROR: Could not load hadoop configuration"); e.printStackTrace(); }