IndexGeneratorTask: Log metrics when complete

This commit is contained in:
Gian Merlino 2012-11-26 11:39:33 -08:00
parent 1e35913579
commit cc8a14d5a1
2 changed files with 13 additions and 0 deletions

View File

@ -81,10 +81,12 @@ public class YeOldePlumberSchool implements PlumberSchool
// There can be only one.
final Sink theSink = new Sink(interval, schema);
// Temporary directory to hold spilled segments.
final File persistDir = new File(
tmpSegmentDir, theSink.getSegment().withVersion(version).getIdentifier()
);
// Set of spilled segments. Will be merged at the end.
final Set<File> spilled = Sets.newHashSet();
return new Plumber()

View File

@ -163,6 +163,17 @@ public class IndexGeneratorTask extends AbstractTask
plumber.persist(firehose.commit());
plumber.finishJob();
// Output metrics
log.info(
"Task[%s] took in %,d rows (%,d processed, %,d unparseable, %,d thrown away) and output %,d rows",
getId(),
metrics.processed() + metrics.unparseable() + metrics.thrownAway(),
metrics.processed(),
metrics.unparseable(),
metrics.thrownAway(),
metrics.rowOutput()
);
// Done
return TaskStatus.success(getId(), ImmutableList.copyOf(pushedSegments));
}