SequenceFile.Reader r= new SequenceFile.Reader(fs, new Path(fname), conf);
System.out.println("key class name is " + r.getKeyClassName());
System.out.println("value class name is " + r.getValueClassName());
ChukwaArchiveKey key = new ChukwaArchiveKey();
ChunkImpl evt = ChunkImpl.getBlankChunk();
int events = 0;
while(r.next(key, evt) && (events < 5))
{
if(!Writable.class.isAssignableFrom(key.getClass()))
System.out.println("warning: keys aren't writable");
if(!Writable.class.isAssignableFrom(evt.getClass()))
System.out.println("warning: values aren't writable");
if(evt.getData().length > 1000)
{
System.out.println("got event; data: " + new String(evt.getData(), 0, 1000));
System.out.println("....[truncating]");
}
else
System.out.println("got event; data: " + new String(evt.getData()));
events ++;
}
System.out.println("file looks OK!");
}
catch(Exception e)