.processAddCommand("add org.apache.hadoop.chukwa.datacollection.adaptor"+
"filetailer.CharFileTailingAdaptorUTF8 "
+ "lines " + startOffset + " " + testFile + " " + startOffset);
assertTrue(adaptorId != null);
System.out.println("getting a chunk...");
Chunk c = chunks.waitForAChunk();
System.out.println("got chunk");
while (!c.getDataType().equals("lines")) {
c = chunks.waitForAChunk();
}
assertTrue(c.getSeqID() == testFile.length() + startOffset);
System.out.println("RecordOffsets length:" + c.getRecordOffsets().length);
assertTrue(c.getRecordOffsets().length == 80); // 80 lines in the file.
int recStart = 0;
for (int rec = 0; rec < c.getRecordOffsets().length; ++rec) {
String record = new String(c.getData(), recStart,
c.getRecordOffsets()[rec] - recStart + 1);
System.out.println("record " + rec + " was: " + record);
assertTrue(record.equals(rec + " abcdefghijklmnopqrstuvwxyz\n"));
recStart = c.getRecordOffsets()[rec] + 1;
}
assertTrue(c.getDataType().equals("lines"));
agent.stopAdaptor(adaptorId, false);
agent.shutdown();
}