public List<TaskReport> run(final TaskSource outputTask) {
TransactionalPageOutput tran = runner.open(outputTask, schema,
1);
boolean committed = false;
try {
ImmutableMapValue jsonValue = newMap(
newString("_c1"), newBoolean(true),
newString("_c2"), newInteger(10),
newString("_c3"), newString("embulk"),
newString("_c4"), newMap(newString("k"), newString("v"))
);
for (Page page : PageTestUtils.buildPage(
runtime.getBufferAllocator(), schema, true, 2L,
3.0D, "45", Timestamp.ofEpochMilli(678L), jsonValue, true, 2L,
3.0D, "45", Timestamp.ofEpochMilli(678L), jsonValue)) {
tran.add(page);
}
tran.commit();
committed = true;
} finally {
if (!committed) {
tran.abort();
}
tran.close();
}
return new ArrayList<TaskReport>();
}
});