From 270a4993cea5ac6f9ceb7f37dcf921749b62bfa5 Mon Sep 17 00:00:00 2001 From: kOD-dKOD Date: Tue, 11 Jun 2013 12:05:17 +0530 Subject: [PATCH] Update RealtimePlumberSchool.java Put a check to make sure that we're only looking for the folder those have number-only names, to avoid "merged" directory issue. --- .../druid/realtime/plumber/RealtimePlumberSchool.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 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 b40221e955e..849cf8ea1a9 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 @@ -383,7 +383,7 @@ public class RealtimePlumberSchool implements PlumberSchool final File[] sinkFiles = sinkDir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String fileName) { - return !fileName.equalsIgnoreCase("merged"); + return !(Ints.tryParse(fileName) == null); } }); Arrays.sort( @@ -409,12 +409,14 @@ public class RealtimePlumberSchool implements PlumberSchool for (File segmentDir : sinkFiles) { log.info("Loading previously persisted segment at [%s]", segmentDir); - // Although this is has been tackled at start of this method. + // Although this has been tackled at start of this method. // Just a doubly-check added to skip "merged" dir. from being added to hydrants // If 100% sure that this is not needed, this check can be removed. - if(segmentDir.getName().equalsIgnoreCase("merged")) + if(Ints.tryParse(segmentDir.getName()) == null) + { continue; - + } + hydrants.add( new FireHydrant( new QueryableIndexSegment(null, IndexIO.loadIndex(segmentDir)),