}
logger.info("packing {} to {}", data, outFile);
StagedWrite stage = StagedWrite.begin(outFile);
try {
BinaryRatingPacker packer = BinaryRatingPacker.open(stage.getStagingFile(), binaryFlags);
try {
Cursor<Rating> ratings = data.getEventDAO().streamEvents(Rating.class);
try {
packer.writeRatings(ratings);
} finally {
ratings.close();
}
} finally {
packer.close();
}
stage.commit();
} catch (IOException ex) {
logger.error("error packing {}: {}", outFile, ex);
throw new TaskExecutionException("error packing " + outFile, ex);