RealtimePlumber: Bail out of persist-n-merge of abandoned sinks (fixes #812).

This commit is contained in:
Gian Merlino 2014-11-13 12:59:49 -08:00
parent d4ca805cb9
commit bf22524d63
1 changed files with 7 additions and 1 deletions

View File

@ -325,7 +325,13 @@ public class RealtimePlumber implements Plumber
{
final Interval interval = sink.getInterval();
// use a file to indicate that pushing has completed
// Bail out if this sink has been abandoned by a previously-executed task.
if (sinks.get(truncatedTime) != sink) {
log.info("Sink[%s] was abandoned, bailing out of persist-n-merge.", sink);
return;
}
// Use a file to indicate that pushing has completed.
final File persistDir = computePersistDir(schema, interval);
final File mergedTarget = new File(persistDir, "merged");
final File isPushedMarker = new File(persistDir, "isPushedMarker");