You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ab...@apache.org on 2020/08/11 17:16:03 UTC

[lucene-solr] 02/02: SOLR-13579: Fix merge issues.

This is an automated email from the ASF dual-hosted git repository.

ab pushed a commit to branch jira/solr-13579
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 2bc8c906cb2730c7edffbe9b8613c1e60049a764
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Tue Aug 11 19:14:23 2020 +0200

    SOLR-13579: Fix merge issues.
---
 .../org/apache/solr/handler/component/RealTimeGetComponent.java   | 4 ++--
 .../core/src/java/org/apache/solr/managed/ResourceManagerAPI.java | 2 +-
 .../org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java | 4 ++--
 .../test/org/apache/solr/handler/component/SearchHandlerTest.java | 8 ++++----
 .../org/apache/solr/handler/component/TermsComponentTest.java     | 2 +-
 .../org/apache/solr/managed/TestResourceManagerIntegration.java   | 1 -
 .../src/test/org/apache/solr/managed/types/TestCacheDynamics.java | 1 -
 .../src/test/org/apache/solr/search/RankQParserPluginTest.java    | 4 +++-
 8 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
index 3568a54..684d0e9 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/RealTimeGetComponent.java
@@ -1128,7 +1128,7 @@ public class RealTimeGetComponent extends SearchComponent
     try (PeerSyncWithLeader peerSync = new PeerSyncWithLeader(rb.req.getCore(), syncWithLeader, nVersions)) {
       boolean success = peerSync.sync(versions).isSuccess();
       rb.rsp.add("syncWithLeader", success);
-    } catch (IOException e) {
+    } catch (Exception e) {
       log.error("Error while closing", e);
     }
   }
@@ -1153,7 +1153,7 @@ public class RealTimeGetComponent extends SearchComponent
       boolean success = peerSync.sync().isSuccess();
       // TODO: more complex response?
       rb.rsp.add("sync", success);
-    } catch (IOException e) {
+    } catch (Exception e) {
       log.error("Error while closing", e);
     }
   }
diff --git a/solr/core/src/java/org/apache/solr/managed/ResourceManagerAPI.java b/solr/core/src/java/org/apache/solr/managed/ResourceManagerAPI.java
index 5f18c03..5d182f3 100644
--- a/solr/core/src/java/org/apache/solr/managed/ResourceManagerAPI.java
+++ b/solr/core/src/java/org/apache/solr/managed/ResourceManagerAPI.java
@@ -41,7 +41,7 @@ import org.apache.solr.api.PayloadObj;
 import org.apache.solr.client.solrj.SolrRequest;
 import org.apache.solr.client.solrj.cloud.DistribStateManager;
 import org.apache.solr.client.solrj.cloud.SolrCloudManager;
-import org.apache.solr.client.solrj.cloud.autoscaling.VersionedData;
+import org.apache.solr.client.solrj.cloud.VersionedData;
 import org.apache.solr.client.solrj.request.beans.ResourcePoolConfig;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.annotation.JsonProperty;
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java
index cf2dd74..79f0a15 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/ZookeeperStatusHandlerTest.java
@@ -163,7 +163,7 @@ public class ZookeeperStatusHandlerTest extends SolrCloudTestCase {
     try (ZookeeperStatusHandler zsh = new ZookeeperStatusHandler(null)) {
      zsh.validateZkRawResponse(Collections.singletonList("mntr is not executed because it is not in the whitelist."),
           "zoo1:2181", "mntr");
-    }  catch (IOException e) {
+    }  catch (Exception e) {
       fail("Error closing ZookeeperStatusHandler");
     }
   }
@@ -172,7 +172,7 @@ public class ZookeeperStatusHandlerTest extends SolrCloudTestCase {
   public void validateEmptyResponse() {
     try (ZookeeperStatusHandler zsh = new ZookeeperStatusHandler(null)) {
       zsh.validateZkRawResponse(Collections.emptyList(), "zoo1:2181", "mntr");
-    } catch (IOException e) {
+    } catch (Exception e) {
       fail("Error closing ZookeeperStatusHandler");
     }
   }
diff --git a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
index f0b2973..5a90582 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/SearchHandlerTest.java
@@ -65,8 +65,8 @@ public class SearchHandlerTest extends SolrTestCaseJ4
       assertEquals(1, handler.getComponents().size());
       assertEquals(core.getSearchComponent(MoreLikeThisComponent.COMPONENT_NAME),
           handler.getComponents().get(0));
-    } catch (IOException e) {
-      fail("IOExcepiton closing SearchHandler");
+    } catch (Exception e) {
+      fail("Excepiton closing SearchHandler");
     }
 
     // Build an explicit list that includes the debug comp.
@@ -89,7 +89,7 @@ public class SearchHandlerTest extends SolrTestCaseJ4
           handler.getComponents().get(1));
       assertEquals(core.getSearchComponent(MoreLikeThisComponent.COMPONENT_NAME),
           handler.getComponents().get(2));
-    } catch (IOException e) {
+    } catch (Exception e) {
       fail("Exception when closing SearchHandler");
     }
     
@@ -115,7 +115,7 @@ public class SearchHandlerTest extends SolrTestCaseJ4
       assertEquals(core.getSearchComponent(FacetComponent.COMPONENT_NAME), comps.get(comps.size() - 2));
       //Debug component is always last in this case
       assertEquals(core.getSearchComponent(DebugComponent.COMPONENT_NAME), comps.get(comps.size() - 1));
-    } catch (IOException e) {
+    } catch (Exception e) {
       fail("Exception when closing SearchHandler");
     }
   }
diff --git a/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java
index 660498a..9863c0e 100644
--- a/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/component/TermsComponentTest.java
@@ -160,7 +160,7 @@ public class TermsComponentTest extends SolrTestCaseJ4 {
         int expected = Pattern.CASE_INSENSITIVE | Pattern.LITERAL | Pattern.COMMENTS | Pattern.MULTILINE | Pattern.UNIX_LINES
             | Pattern.UNICODE_CASE | Pattern.DOTALL | Pattern.CANON_EQ;
         assertEquals(expected, flags);
-      } catch (IOException e) {
+      } catch (Exception e) {
         fail("Error closing TermsComponent");
       }
   }
diff --git a/solr/core/src/test/org/apache/solr/managed/TestResourceManagerIntegration.java b/solr/core/src/test/org/apache/solr/managed/TestResourceManagerIntegration.java
index b778543..2c7bebc 100644
--- a/solr/core/src/test/org/apache/solr/managed/TestResourceManagerIntegration.java
+++ b/solr/core/src/test/org/apache/solr/managed/TestResourceManagerIntegration.java
@@ -61,7 +61,6 @@ public class TestResourceManagerIntegration extends SolrCloudTestCase {
         .configure();
     cloudManager = cluster.getJettySolrRunner(0).getCoreContainer().getZkController().getSolrCloudManager();
     CollectionAdminRequest.createCollection(COLLECTION, "conf", 2, 2)
-        .setMaxShardsPerNode(5)
         .process(cluster.getSolrClient());
     CloudUtil.waitForState(cloudManager, "failed to create collection", COLLECTION, CloudUtil.clusterShape(2, 2));
     resourceManager = cluster.getJettySolrRunner(0).getCoreContainer().getResourceManagerApi().getResourceManager();
diff --git a/solr/core/src/test/org/apache/solr/managed/types/TestCacheDynamics.java b/solr/core/src/test/org/apache/solr/managed/types/TestCacheDynamics.java
index 0d01016..5246718 100644
--- a/solr/core/src/test/org/apache/solr/managed/types/TestCacheDynamics.java
+++ b/solr/core/src/test/org/apache/solr/managed/types/TestCacheDynamics.java
@@ -100,7 +100,6 @@ public class TestCacheDynamics extends SolrCloudTestCase {
         .configure();
     cloudManager = cluster.getJettySolrRunner(0).getCoreContainer().getZkController().getSolrCloudManager();
     CollectionAdminRequest.createCollection(COLLECTION, "conf", 2, 2)
-        .setMaxShardsPerNode(5)
         .process(cluster.getSolrClient());
     CloudUtil.waitForState(cloudManager, "failed to create collection", COLLECTION, CloudUtil.clusterShape(2, 2));
     resourceManager = cluster.getJettySolrRunner(0).getCoreContainer().getResourceManagerApi().getResourceManager();
diff --git a/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java b/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
index 2e88ce2..e9d28e1 100644
--- a/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
+++ b/solr/core/src/test/org/apache/solr/search/RankQParserPluginTest.java
@@ -53,7 +53,7 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
     assertEquals("RankQParserPlugin.EXPONENT changed in an incompatible way", "exponent", EXPONENT);
   }
   
-  public void testCreateParser() throws IOException {
+  public void testCreateParser() throws Exception {
     try (RankQParserPlugin rankQPPlugin = new RankQParserPlugin()) {
       QParser parser = rankQPPlugin.createParser("", new ModifiableSolrParams(), null, req()); 
       assertNotNull(parser);
@@ -252,6 +252,8 @@ public class RankQParserPluginTest extends SolrTestCaseJ4 {
   private RankQParser getRankQParser(SolrParams localParams, SolrParams params, SolrQueryRequest req) throws IOException {
     try (RankQParserPlugin rankQPPlugin = new RankQParserPlugin()) {
       return (RankQParser) rankQPPlugin.createParser("", localParams, params, req);
+    } catch (Exception e) {
+      throw new IOException(e);
     }
   }