it's safe to use OneMerge.getTotalBytesSize (fixed in LUCENE-4775)

This commit is contained in:
mikemccand 2014-05-07 17:24:57 -04:00
parent f23274523a
commit 82aad78ff2
2 changed files with 4 additions and 6 deletions

View File

@ -89,8 +89,7 @@ public class TrackingConcurrentMergeScheduler extends ConcurrentMergeScheduler {
@Override
protected void doMerge(MergePolicy.OneMerge merge) throws IOException {
int totalNumDocs = merge.totalNumDocs();
// don't used #totalBytesSize() since need to be executed under IW lock, might be fixed in future Lucene version
long totalSizeInBytes = merge.estimatedMergeBytes;
long totalSizeInBytes = merge.totalBytesSize();
long time = System.currentTimeMillis();
currentMerges.inc();
currentMergesNumDocs.inc(totalNumDocs);
@ -146,4 +145,4 @@ public class TrackingConcurrentMergeScheduler extends ConcurrentMergeScheduler {
// the clone will just be the identity.
return this;
}
}
}

View File

@ -103,8 +103,7 @@ public class TrackingSerialMergeScheduler extends MergeScheduler {
writer.mergeInit(merge);
int totalNumDocs = merge.totalNumDocs();
// don't used #totalBytesSize() since need to be executed under IW lock, might be fixed in future Lucene version
long totalSizeInBytes = merge.estimatedMergeBytes;
long totalSizeInBytes = merge.totalBytesSize();
long time = System.currentTimeMillis();
currentMerges.inc();
currentMergesNumDocs.inc(totalNumDocs);
@ -166,4 +165,4 @@ public class TrackingSerialMergeScheduler extends MergeScheduler {
// the clone will just be the identity.
return this;
}
}
}