Skip to content

Commit

Permalink
Common up some downcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
timatbw committed Jan 18, 2018
1 parent 98ffa4b commit f1d6f54
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,16 +372,16 @@ private MergeScheduler buildMergeScheduler(IndexSchema schema) {
// LUCENE-5080: these two setters are removed, so we have to invoke setMaxMergesAndThreads
// if someone has them configured.
if (scheduler instanceof ConcurrentMergeScheduler) {
ConcurrentMergeScheduler cmScheduler = (ConcurrentMergeScheduler) scheduler;
NamedList args = mergeSchedulerInfo.initArgs.clone();
Integer maxMergeCount = (Integer) args.remove("maxMergeCount");
if (maxMergeCount == null) {
maxMergeCount = ((ConcurrentMergeScheduler) scheduler).getMaxMergeCount();
maxMergeCount = cmScheduler.getMaxMergeCount();
}
Integer maxThreadCount = (Integer) args.remove("maxThreadCount");
if (maxThreadCount == null) {
maxThreadCount = ((ConcurrentMergeScheduler) scheduler).getMaxThreadCount();
maxThreadCount = cmScheduler.getMaxThreadCount();
}
ConcurrentMergeScheduler cmScheduler = (ConcurrentMergeScheduler)scheduler;
cmScheduler.setMaxMergesAndThreads(maxMergeCount, maxThreadCount);
Boolean autoIOThrottle = (Boolean) args.remove("autoIOThrottle");
if (autoIOThrottle != null) {
Expand Down

0 comments on commit f1d6f54

Please sign in to comment.