configure(context, group.getFormat()));
DirectDataSource datasource = repository.getRelatedDataSource(path);
String basePath = repository.getComponentPath(path);
String resourcePath = variables.parse(group.getResourcePath());
Counter counter = new Counter();
ModelOutput output = datasource.openOutput(outputContext, definition, basePath, resourcePath, counter);
long records = 0;
try {
for (Union union : values) {
Object object = union.getObject();
output.write(object);
records++;
}
} finally {
output.close();
}
recordCounter.increment(records);
context.getCounter(COUNTER_GROUP, id + ".files").increment(1);
context.getCounter(COUNTER_GROUP, id + ".records").increment(records);
context.getCounter(COUNTER_GROUP, id + ".size").increment(counter.get());
}