Merge pull request #867 from metamx/avoid-abandoned-sinks

RealtimePlumber: Bail out of persist-n-merge of abandoned sinks (fixes #812)
This commit is contained in:
Fangjin Yang 2014-11-14 18:35:00 -07:00
commit 0b45942cff
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");