From 369412262e090236ed4f3a6c4c6181852d8b8193 Mon Sep 17 00:00:00 2001 From: cheddar Date: Wed, 19 Jun 2013 11:15:58 -0700 Subject: [PATCH] 1) Fix truncation math when figuring out what Segments to persist for realtime plumber. Previously, Sinks could get persist-n-merged without actually being ready to be persist-n-merged. Fixes #168 --- .../metamx/druid/realtime/plumber/RealtimePlumberSchool.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/realtime/src/main/java/com/metamx/druid/realtime/plumber/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/plumber/RealtimePlumberSchool.java index 21a28062537..00a0891cbde 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/plumber/RealtimePlumberSchool.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/plumber/RealtimePlumberSchool.java @@ -514,8 +514,9 @@ public class RealtimePlumberSchool implements PlumberSchool log.info("Starting merge and push."); - long minTimestamp = segmentGranularity.truncate(rejectionPolicy.getCurrMaxTime()).getMillis() - - windowMillis; + long minTimestamp = segmentGranularity.truncate( + rejectionPolicy.getCurrMaxTime().minus(windowMillis) + ).getMillis(); List> sinksToPush = Lists.newArrayList(); for (Map.Entry entry : sinks.entrySet()) {