From 40cd3c239eb05c7c8cfec74361b76419bf0f4fea Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 2 May 2012 21:18:31 +0300 Subject: [PATCH] call mergeInit in the serial merge scheduler case to get proper stats for it --- .../org/apache/lucene/index/TrackingSerialMergeScheduler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java b/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java index ce37d5c7821..0e4c426790d 100644 --- a/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java +++ b/src/main/java/org/apache/lucene/index/TrackingSerialMergeScheduler.java @@ -83,6 +83,10 @@ public class TrackingSerialMergeScheduler extends MergeScheduler { if (merge == null) break; + // different from serial merge, call mergeInit here so we get the correct stats + // mergeInit can be called several times without side affects (checks on merge.info not being null) + writer.mergeInit(merge); + int totalNumDocs = merge.totalNumDocs(); long totalSizeInBytes = merge.totalBytesSize(); long time = System.currentTimeMillis();