private static void dumpFile(Path p, Configuration conf,
FileSystem fs) throws IOException {
SequenceFile.Reader r = new SequenceFile.Reader(fs, p, conf);
ChukwaArchiveKey key = new ChukwaArchiveKey();
ChunkImpl chunk = ChunkImpl.getBlankChunk();
try {
while (r.next(key, chunk)) {
String entryKey = chunk.getSource() +":"+chunk.getDataType() +":" +
chunk.getStreamName();
Integer oldC = counts.get(entryKey);
if(oldC != null)
counts.put(entryKey, oldC + 1);
else
counts.put(entryKey, new Integer(1));
if(!summarize) {
System.out.println("\nTimePartition: " + key.getTimePartition());
System.out.println("DataType: " + key.getDataType());
System.out.println("StreamName: " + key.getStreamName());
System.out.println("SeqId: " + key.getSeqId());
System.out.println("\t\t =============== ");
System.out.println("Cluster : " + chunk.getTags());
System.out.println("DataType : " + chunk.getDataType());
System.out.println("Source : " + chunk.getSource());
System.out.println("Application : " + chunk.getStreamName());
System.out.println("SeqID : " + chunk.getSeqID());
System.out.println("Data : " + new String(chunk.getData()));
}
}
} catch (Exception e) {
e.printStackTrace();
}