BufferedWriter out = null;
try {
reader = new SequenceFile.Reader(fs, new Path(dataSinkFile), conf);
ChukwaArchiveKey key = new ChukwaArchiveKey();
ChunkImpl chunk = ChunkImpl.getBlankChunk();
String dataSinkDumpName = dataSinkFile + ".dump";
out = new BufferedWriter(new FileWriter(dataSinkDumpName));
while (reader.next(key, chunk)) {
Assert.assertTrue(cluster.equals(RecordUtil.getClusterName(chunk)));
Assert.assertTrue(dataType.equals(chunk.getDataType()));
Assert.assertTrue(source.equals(chunk.getSource()));
out.write(new String(chunk.getData()));
lastSeqId = chunk.getSeqID() ;
}
out.close();
out = null;
reader.close();