From f062e136d09569cc207cf7359c59a887d1bc2107 Mon Sep 17 00:00:00 2001 From: Eric Tschetter Date: Tue, 30 Oct 2012 10:59:07 -0500 Subject: [PATCH] 1) Fix bug with sharded realtime data ingestion --- .../java/com/metamx/druid/client/DataSegment.java | 5 +++++ .../metamx/druid/realtime/RealtimePlumberSchool.java | 12 +----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/client/src/main/java/com/metamx/druid/client/DataSegment.java b/client/src/main/java/com/metamx/druid/client/DataSegment.java index 15cc8e672f5..1f7fcc42d19 100644 --- a/client/src/main/java/com/metamx/druid/client/DataSegment.java +++ b/client/src/main/java/com/metamx/druid/client/DataSegment.java @@ -194,6 +194,11 @@ public class DataSegment implements Comparable return builder(this).loadSpec(loadSpec).build(); } + public DataSegment withDimensions(List dimensions) + { + return builder(this).dimensions(dimensions).build(); + } + public DataSegment withSize(long size) { return builder(this).size(size).build(); diff --git a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java index 9c5c5ee2ec0..5659758591b 100644 --- a/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java +++ b/realtime/src/main/java/com/metamx/druid/realtime/RealtimePlumberSchool.java @@ -307,16 +307,7 @@ public class RealtimePlumberSchool implements PlumberSchool DataSegment segment = segmentPusher.push( mergedFile, - new DataSegment( - schema.getDataSource(), - interval, - interval.getStart().toString(), - null, - Lists.newArrayList(index.getAvailableDimensions()), - Lists.newArrayList(index.getAvailableMetrics()), - new NoneShardSpec(), - 0 - ) + sink.getSegment().withDimensions(Lists.newArrayList(index.getAvailableDimensions())) ); metadataUpdater.publishSegment(segment); @@ -325,7 +316,6 @@ public class RealtimePlumberSchool implements PlumberSchool log.makeAlert(e, "Failed to persist merged index[%s]", schema.getDataSource()) .addData("interval", interval) .emit(); - return; } } }