final File inDir = new File(testDir, "in");
inDir.mkdirs();
// create input with 100 records with 10% of records with errors.
RawBlockWriter blk_writer = new RawBlockWriter(createLzoOut(new File(inDir, "1-block.lzo"), conf));
TestPerson person = records[records.length - 1];
String expectedStr = personToString(person);
byte[] properRec = tConverter.toBytes(person);
byte[] truncatedRec = Arrays.copyOfRange(properRec, 0, properRec.length*3/4);
final int totalRecords = 100;
final int pctErrors = 10;
final int totalErrors = totalRecords * pctErrors / 100;
final int goodRecords = totalRecords - totalErrors;
int corruptIdx = new Random().nextInt(10);
for(int i=0; i<totalRecords; i++) {
blk_writer.write((i%10 == corruptIdx) ? truncatedRec : properRec);
}
blk_writer.close();
String[] expectedRows = new String[goodRecords];
for (int i=0; i<goodRecords; i++){
expectedRows[i] = expectedStr;
}