From f1d6f54e2655f12c4f624a870cebb53fbc90d6aa Mon Sep 17 00:00:00 2001 From: Tim Owen Date: Thu, 18 Jan 2018 16:54:28 +0000 Subject: [PATCH] Common up some downcasts --- .../src/java/org/apache/solr/update/SolrIndexConfig.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java index d68d9eb286b4..b91e1675b858 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java +++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java @@ -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) {