You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ro...@apache.org on 2015/02/27 13:17:52 UTC

svn commit: r1662670 - in /lucene/dev/trunk/solr: ./ contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/ contrib/map-reduce/src/test/org/apache/solr/hadoop/ core/src/test/org/apache/solr/ core/src/test/org/apache/solr/cloud/ core/src...

Author: romseygeek
Date: Fri Feb 27 12:17:51 2015
New Revision: 1662670

URL: http://svn.apache.org/r1662670
Log:
SOLR-7151: SolrClient query methods throw IOException

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java
    lucene/dev/trunk/solr/contrib/map-reduce/src/test/org/apache/solr/hadoop/MorphlineGoLiveMiniMRTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
    lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
    lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
    lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
    lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
    lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/CloudInspectUtil.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Fri Feb 27 12:17:51 2015
@@ -71,6 +71,16 @@ Apache UIMA 2.3.1
 Apache ZooKeeper 3.4.6
 Jetty 9.2.6.v20141205
 
+Upgrading from Solr 5.0
+-----------------------
+
+* SolrClient query functions now declare themselves as throwing IOException in
+  addition to SolrServerException, to bring them in line with the update
+  functions.
+
+* SolrRequest.process() is now final.  Subclasses should instead be parametrized
+  by their corresponding SolrResponse type, and implement createResponse()
+
 Detailed Change List
 ----------------------
 
@@ -216,6 +226,8 @@ Other Changes
 * SOLR-7130: Make stale state notification work without failing the requests
   (Noble Paul, shalin)
 
+* SOLR-7151: SolrClient query methods throw IOException
+
 ==================  5.0.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.

Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java Fri Feb 27 12:17:51 2015
@@ -196,7 +196,7 @@ public class SolrEntityProcessor extends
     QueryResponse response = null;
     try {
       response = solrClient.query(solrQuery);
-    } catch (SolrServerException e) {
+    } catch (SolrServerException | IOException e) {
       if (ABORT.equals(onError)) {
         wrapAndThrow(SEVERE, e);
       } else if (SKIP.equals(onError)) {

Modified: lucene/dev/trunk/solr/contrib/map-reduce/src/test/org/apache/solr/hadoop/MorphlineGoLiveMiniMRTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/map-reduce/src/test/org/apache/solr/hadoop/MorphlineGoLiveMiniMRTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/map-reduce/src/test/org/apache/solr/hadoop/MorphlineGoLiveMiniMRTest.java (original)
+++ lucene/dev/trunk/solr/contrib/map-reduce/src/test/org/apache/solr/hadoop/MorphlineGoLiveMiniMRTest.java Fri Feb 27 12:17:51 2015
@@ -686,7 +686,7 @@ public class MorphlineGoLiveMiniMRTest e
     }
   }
   
-  private SolrDocumentList executeSolrQuery(SolrClient collection, String queryString) throws SolrServerException {
+  private SolrDocumentList executeSolrQuery(SolrClient collection, String queryString) throws SolrServerException, IOException {
     SolrQuery query = new SolrQuery(queryString).setRows(2 * RECORD_COUNT).addSort("id", ORDER.asc);
     QueryResponse response = collection.query(query);
     return response.getResults();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedGrouping.java Fri Feb 27 12:17:51 2015
@@ -26,6 +26,8 @@ import org.apache.solr.common.params.Mod
 import org.apache.solr.common.util.NamedList;
 import org.junit.Test;
 
+import java.io.IOException;
+
 /**
  * TODO? perhaps use:
  *  http://docs.codehaus.org/display/JETTY/ServletTester
@@ -266,7 +268,7 @@ public class TestDistributedGrouping ext
     simpleQuery("q", "*:*", "rows", 10, "fl", "id," + i1, "group", "true", "group.field", i1, "debug", "true");
   }
 
-  private void simpleQuery(Object... queryParams) throws SolrServerException {
+  private void simpleQuery(Object... queryParams) throws SolrServerException, IOException {
     ModifiableSolrParams params = new ModifiableSolrParams();
     for (int i = 0; i < queryParams.length; i += 2) {
       params.add(queryParams[i].toString(), queryParams[i + 1].toString());

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedSearch.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedSearch.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestDistributedSearch.java Fri Feb 27 12:17:51 2015
@@ -17,11 +17,6 @@
 
 package org.apache.solr;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
 import org.apache.commons.lang.StringUtils;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.solr.client.solrj.SolrClient;
@@ -39,6 +34,12 @@ import org.apache.solr.common.params.Sha
 import org.apache.solr.common.util.NamedList;
 import org.junit.Test;
 
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
 /**
  * TODO? perhaps use:
  *  http://docs.codehaus.org/display/JETTY/ServletTester
@@ -633,7 +634,7 @@ public class TestDistributedSearch exten
                 if (verifyStress) {
                   comparePartialResponses(rsp, controlRsp, upShards);
                 }
-              } catch (SolrServerException e) {
+              } catch (SolrServerException | IOException e) {
                 throw new RuntimeException(e);
               }
             }
@@ -648,7 +649,7 @@ public class TestDistributedSearch exten
     }
   }
 
-  protected QueryResponse queryRandomUpServer(ModifiableSolrParams params, List<SolrClient> upClients) throws SolrServerException {
+  protected QueryResponse queryRandomUpServer(ModifiableSolrParams params, List<SolrClient> upClients) throws SolrServerException, IOException {
     // query a random "up" server
     int which = r.nextInt(upClients.size());
     SolrClient client = upClients.get(which);

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestTolerantSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestTolerantSearch.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestTolerantSearch.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/TestTolerantSearch.java Fri Feb 27 12:17:51 2015
@@ -109,7 +109,7 @@ public class TestTolerantSearch extends
   }
   
   @SuppressWarnings("unchecked")
-  public void testGetFieldsPhaseError() throws SolrServerException {
+  public void testGetFieldsPhaseError() throws SolrServerException, IOException {
     BadResponseWriter.failOnGetFields = true;
     BadResponseWriter.failOnGetTopIds = false;
     SolrQuery query = new SolrQuery();
@@ -157,7 +157,7 @@ public class TestTolerantSearch extends
   }
   
   @SuppressWarnings("unchecked")
-  public void testGetTopIdsPhaseError() throws SolrServerException {
+  public void testGetTopIdsPhaseError() throws SolrServerException, IOException {
     BadResponseWriter.failOnGetTopIds = true;
     BadResponseWriter.failOnGetFields = false;
     SolrQuery query = new SolrQuery();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java Fri Feb 27 12:17:51 2015
@@ -1127,7 +1127,7 @@ public class BasicDistributedZkTest exte
   }
 
   @Override
-  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException {
+  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException, IOException {
 
     if (r.nextBoolean())
       return super.queryServer(params);

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java Fri Feb 27 12:17:51 2015
@@ -1144,7 +1144,7 @@ public class CollectionsAPIDistributedZk
   }
 
   @Override
-  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException {
+  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException, IOException {
 
     if (r.nextBoolean())
       return super.queryServer(params);

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java Fri Feb 27 12:17:51 2015
@@ -42,6 +42,7 @@ import org.apache.solr.util.DefaultSolrT
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -447,7 +448,7 @@ public class CustomCollectionTest extend
 
 
   @Override
-  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException {
+  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException, IOException {
 
     if (r.nextBoolean())
       return super.queryServer(params);

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/DistribDocExpirationUpdateProcessorTest.java Fri Feb 27 12:17:51 2015
@@ -168,8 +168,8 @@ public class DistribDocExpirationUpdateP
    * Query is garunteed to be executed at least once.
    */
   private void waitForNoResults(int maxTimeLimitSeconds,
-                                SolrParams params) 
-    throws SolrServerException, InterruptedException {
+                                SolrParams params)
+      throws SolrServerException, InterruptedException, IOException {
 
     final long giveUpAfter = System.currentTimeMillis() + (1000L * maxTimeLimitSeconds);
     long numFound = cloudClient.query(params).getResults().getNumFound();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/FullSolrCloudDistribCmdsTest.java Fri Feb 27 12:17:51 2015
@@ -751,7 +751,7 @@ public class FullSolrCloudDistribCmdsTes
     assertEquals(1, res.getResults().getNumFound());
   }
 
-  private QueryResponse query(SolrClient client) throws SolrServerException {
+  private QueryResponse query(SolrClient client) throws SolrServerException, IOException {
     SolrQuery query = new SolrQuery("*:*");
     return client.query(query);
   }

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java Fri Feb 27 12:17:51 2015
@@ -16,36 +16,42 @@
  */
 package org.apache.solr.cloud;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.SolrTestCaseJ4.SuppressSSL;
 import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.FieldStatsInfo;
-import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.client.solrj.response.PivotField;
+import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.params.FacetParams;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.params.StatsParams;
 import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.schema.TrieDateField;
-
-import org.apache.solr.common.params.FacetParams; // jdoc lint
-import static org.apache.solr.common.params.FacetParams.*;
-
-import org.apache.commons.lang.StringUtils;
-
 import org.junit.BeforeClass;
-
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.util.Arrays;
-import java.util.Set;
+import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Date;
+import java.util.Set;
+
+import static org.apache.solr.common.params.FacetParams.FACET;
+import static org.apache.solr.common.params.FacetParams.FACET_LIMIT;
+import static org.apache.solr.common.params.FacetParams.FACET_MISSING;
+import static org.apache.solr.common.params.FacetParams.FACET_OFFSET;
+import static org.apache.solr.common.params.FacetParams.FACET_OVERREQUEST_COUNT;
+import static org.apache.solr.common.params.FacetParams.FACET_OVERREQUEST_RATIO;
+import static org.apache.solr.common.params.FacetParams.FACET_PIVOT;
+import static org.apache.solr.common.params.FacetParams.FACET_PIVOT_MINCOUNT;
+import static org.apache.solr.common.params.FacetParams.FACET_SORT;
 
 /**
  * <p>
@@ -319,8 +325,8 @@ public class TestCloudPivotFacet extends
    * @param constraint filters on pivot
    * @param params base solr parameters
    */
-  private void assertPivotData(String pivotName, PivotField constraint, SolrParams params) 
-    throws SolrServerException {
+  private void assertPivotData(String pivotName, PivotField constraint, SolrParams params)
+      throws SolrServerException, IOException {
     
     SolrParams p = SolrParams.wrapDefaults(params("rows","0"), params);
     QueryResponse res = cloudClient.query(p);

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java Fri Feb 27 12:17:51 2015
@@ -18,7 +18,6 @@ package org.apache.solr.handler;
 
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.FSDirectory;
-import org.apache.lucene.util.IOUtils;
 import org.apache.lucene.util.LuceneTestCase.Slow;
 import org.apache.lucene.util.TestUtil;
 import org.apache.solr.BaseDistributedSearchTestCase;
@@ -172,7 +171,7 @@ public class TestReplicationHandler exte
     return s.add(doc).getStatus();
   }
 
-  NamedList query(String query, SolrClient s) throws SolrServerException {
+  NamedList query(String query, SolrClient s) throws SolrServerException, IOException {
     NamedList res = new SimpleOrderedMap();
     ModifiableSolrParams params = new ModifiableSolrParams();
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/admin/ShowFileRequestHandlerTest.java Fri Feb 27 12:17:51 2015
@@ -45,7 +45,7 @@ public class ShowFileRequestHandlerTest
     createJetty(legacyExampleCollection1SolrHome(), null, null);
   }
 
-  public void test404ViaHttp() throws SolrServerException {
+  public void test404ViaHttp() throws SolrServerException, IOException {
     SolrClient client = getSolrClient();
     QueryRequest request = new QueryRequest(params("file",
                                                    "does-not-exist-404.txt"));
@@ -80,7 +80,7 @@ public class ShowFileRequestHandlerTest
     }
   }
 
-  public void testDirList() throws SolrServerException {
+  public void testDirList() throws SolrServerException, IOException {
     SolrClient client = getSolrClient();
     //assertQ(req("qt", "/admin/file")); TODO file bug that SolrJettyTestBase extends SolrTestCaseJ4
     QueryRequest request = new QueryRequest();

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java Fri Feb 27 12:17:51 2015
@@ -18,6 +18,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -263,7 +264,7 @@ public class DistributedDebugComponentTe
     
   }
   
-  private void verifyDebugSections(SolrQuery query, SolrClient client) throws SolrServerException {
+  private void verifyDebugSections(SolrQuery query, SolrClient client) throws SolrServerException, IOException {
     query.set("debugQuery", "true");
     query.remove("debug");
     QueryResponse response = client.query(query);
@@ -343,7 +344,7 @@ public class DistributedDebugComponentTe
     assertNull(response.getDebugMap());
   }
   
-  public void testCompareWithNonDistributedRequest() throws SolrServerException {
+  public void testCompareWithNonDistributedRequest() throws SolrServerException, IOException {
     SolrQuery query = new SolrQuery();
     query.setQuery("id:1");
     query.setFilterQueries("id:[0 TO 10]");
@@ -375,7 +376,7 @@ public class DistributedDebugComponentTe
     assertSameKeys((NamedList<?>)nonDistribResponse.getDebugMap().get("timing"), (NamedList<?>)distribResponse.getDebugMap().get("timing"));
   }
   
-  public void testTolerantSearch() throws SolrServerException {
+  public void testTolerantSearch() throws SolrServerException, IOException {
     String badShard = "[ff01::0083]:3334";
     SolrQuery query = new SolrQuery();
     query.setQuery("*:*");

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/handler/component/DistributedQueryComponentOptimizationTest.java Fri Feb 27 12:17:51 2015
@@ -17,12 +17,6 @@ package org.apache.solr.handler.componen
  * limitations under the License.
  */
 
-import java.nio.ByteBuffer;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
 import org.apache.solr.common.params.CommonParams;
@@ -31,6 +25,12 @@ import org.apache.solr.common.util.Simpl
 import org.apache.solr.common.util.StrUtils;
 import org.junit.Test;
 
+import java.nio.ByteBuffer;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * Test for QueryComponent's distributed querying optimization.
  * If the "fl" param is just "id" or just "id,score", all document data to return is already fetched by STAGE_EXECUTE_QUERY.

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/request/TestRemoteStreaming.java Fri Feb 27 12:17:51 2015
@@ -125,7 +125,7 @@ public class TestRemoteStreaming extends
   /** SOLR-3161
    * Technically stream.body isn't remote streaming, but there wasn't a better place for this test method. */
   @Test(expected = SolrException.class)
-  public void testQtUpdateFails() throws SolrServerException {
+  public void testQtUpdateFails() throws SolrServerException, IOException {
     SolrQuery query = new SolrQuery();
     query.setQuery( "*:*" );//for anything
     query.add("echoHandler","true");
@@ -152,7 +152,7 @@ public class TestRemoteStreaming extends
     return client.getBaseURL()+"/update?commit=true&stream.body="+ URLEncoder.encode(deleteQuery, "UTF-8");
   }
 
-  private boolean searchFindsIt() throws SolrServerException {
+  private boolean searchFindsIt() throws SolrServerException, IOException {
     SolrQuery query = new SolrQuery();
     query.setQuery( "id:1234" );
     QueryResponse rsp = getSolrClient().query(query);

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrClient.java Fri Feb 27 12:17:51 2015
@@ -305,7 +305,7 @@ public abstract class SolrClient impleme
    * Performs a query to the Solr server
    * @param params  an object holding all key/value parameters to send along the request
    */
-  public QueryResponse query(SolrParams params) throws SolrServerException {
+  public QueryResponse query(SolrParams params) throws SolrServerException, IOException {
     return new QueryRequest(params).process(this);
   }
 
@@ -314,7 +314,7 @@ public abstract class SolrClient impleme
    * @param params  an object holding all key/value parameters to send along the request
    * @param method  specifies the HTTP method to use for the request, such as GET or POST
    */
-  public QueryResponse query(SolrParams params, METHOD method) throws SolrServerException {
+  public QueryResponse query(SolrParams params, METHOD method) throws SolrServerException, IOException {
     return new QueryRequest(params, method).process(this);
   }
 
@@ -343,7 +343,7 @@ public abstract class SolrClient impleme
    *
    * @return retrieved SolrDocument, null if no document is found.
    */
-  public SolrDocument getById(String id) throws SolrServerException {
+  public SolrDocument getById(String id) throws SolrServerException, IOException {
     return getById(id, null);
   }
 
@@ -353,7 +353,7 @@ public abstract class SolrClient impleme
    *
    * @return retrieved SolrDocument, null if no document is found.
    */
-  public SolrDocument getById(String id, SolrParams params) throws SolrServerException {
+  public SolrDocument getById(String id, SolrParams params) throws SolrServerException, IOException {
     SolrDocumentList docs = getById(Arrays.asList(id), params);
     if (!docs.isEmpty()) {
       return docs.get(0);
@@ -365,7 +365,7 @@ public abstract class SolrClient impleme
    * Retrieves the SolrDocuments associated with the given identifiers.
    * If a document was not found, it will not be added to the SolrDocumentList.
    */
-  public SolrDocumentList getById(Collection<String> ids) throws SolrServerException {
+  public SolrDocumentList getById(Collection<String> ids) throws SolrServerException, IOException {
     return getById(ids, null);
   }
 
@@ -374,7 +374,7 @@ public abstract class SolrClient impleme
    * the SolrParams to execute the request.
    * If a document was not found, it will not be added to the SolrDocumentList.
    */
-  public SolrDocumentList getById(Collection<String> ids, SolrParams params) throws SolrServerException {
+  public SolrDocumentList getById(Collection<String> ids, SolrParams params) throws SolrServerException, IOException {
     if (ids == null || ids.isEmpty()) {
       throw new IllegalArgumentException("Must provide an identifier of a document to retrieve.");
     }

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java Fri Feb 27 12:17:51 2015
@@ -125,7 +125,7 @@ public abstract class SolrRequest<T exte
    * @throws SolrServerException if there is an error on the Solr server
    * @throws IOException if there is a communication error
    */
-  public T process(SolrClient client) throws SolrServerException, IOException {
+  public final T process(SolrClient client) throws SolrServerException, IOException {
     long startTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
     T res = createResponse(client);
     res.setResponse(client.request(this));

Modified: lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java (original)
+++ lucene/dev/trunk/solr/solrj/src/java/org/apache/solr/client/solrj/request/QueryRequest.java Fri Feb 27 12:17:51 2015
@@ -19,15 +19,12 @@ package org.apache.solr.client.solrj.req
 
 import org.apache.solr.client.solrj.SolrClient;
 import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.client.solrj.response.QueryResponse;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.ContentStream;
 
-import java.io.IOException;
 import java.util.Collection;
-import java.util.concurrent.TimeUnit;
 
 /**
  * 
@@ -83,26 +80,6 @@ public class QueryRequest extends SolrRe
     return new QueryResponse(client);
   }
 
-  /**
-   * Send this request to a {@link SolrClient} and return the response
-   * @param client the SolrClient to communicate with
-   * @return the response
-   * @throws org.apache.solr.client.solrj.SolrServerException if there is an error on the Solr server
-   */
-  @Override
-  public QueryResponse process(SolrClient client) throws SolrServerException {
-    long startTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
-    QueryResponse res = createResponse(client);
-    try {
-      res.setResponse(client.request(this));
-    } catch (IOException e) {
-      throw new SolrServerException("Error executing query", e);
-    }
-    long endTime = TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS);
-    res.setElapsedTime(endTime - startTime);
-    return res;
-  }
-
   @Override
   public SolrParams getParams() {
     return query;

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java (original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/LargeVolumeTestBase.java Fri Feb 27 12:17:51 2015
@@ -26,6 +26,7 @@ import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -65,7 +66,7 @@ public abstract class LargeVolumeTestBas
     log.info("done");
   }
 
-  private void query(int count) throws SolrServerException {
+  private void query(int count) throws SolrServerException, IOException {
     SolrClient client = this.getSolrClient();
     SolrQuery query = new SolrQuery("*:*");
     QueryResponse response = client.query(query);

Modified: lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java (original)
+++ lucene/dev/trunk/solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java Fri Feb 27 12:17:51 2015
@@ -1441,7 +1441,7 @@ abstract public class SolrExampleTests e
   }
   
   @Test
-  public void testQueryWithParams() throws SolrServerException {
+  public void testQueryWithParams() throws SolrServerException, IOException {
     SolrClient client = getSolrClient();
     SolrQuery q = new SolrQuery("query");
     q.setParam("debug", true);

Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java Fri Feb 27 12:17:51 2015
@@ -536,7 +536,7 @@ public abstract class BaseDistributedSea
     }
   }
 
-  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException {
+  protected QueryResponse queryServer(ModifiableSolrParams params) throws SolrServerException, IOException {
     // query a random server
     int which = r.nextInt(clients.size());
     SolrClient client = clients.get(which);
@@ -607,7 +607,7 @@ public abstract class BaseDistributedSea
                 if (verifyStress) {
                   compareResponses(rsp, controlRsp);
                 }
-              } catch (SolrServerException e) {
+              } catch (SolrServerException | IOException e) {
                 throw new RuntimeException(e);
               }
             }
@@ -623,10 +623,10 @@ public abstract class BaseDistributedSea
     return rsp;
   }
   
-  public QueryResponse queryAndCompare(SolrParams params, SolrClient... clients) throws SolrServerException {
+  public QueryResponse queryAndCompare(SolrParams params, SolrClient... clients) throws SolrServerException, IOException {
     return queryAndCompare(params, Arrays.<SolrClient>asList(clients));
   }
-  public QueryResponse queryAndCompare(SolrParams params, Iterable<SolrClient> clients) throws SolrServerException {
+  public QueryResponse queryAndCompare(SolrParams params, Iterable<SolrClient> clients) throws SolrServerException, IOException {
     QueryResponse first = null;
     for (SolrClient client : clients) {
       QueryResponse rsp = client.query(new ModifiableSolrParams(params));

Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java Fri Feb 27 12:17:51 2015
@@ -1191,11 +1191,7 @@ public abstract class AbstractFullDistri
           long num = cjetty.client.solrClient.query(query).getResults()
               .getNumFound();
           System.err.println("DOCS:" + num);
-        } catch (SolrServerException e) {
-          System.err.println("error contacting client: " + e.getMessage()
-              + "\n");
-          continue;
-        } catch (SolrException e) {
+        } catch (SolrServerException | SolrException | IOException e) {
           System.err.println("error contacting client: " + e.getMessage()
               + "\n");
           continue;
@@ -1401,7 +1397,7 @@ public abstract class AbstractFullDistri
 
   @Override
   protected QueryResponse queryServer(ModifiableSolrParams params)
-      throws SolrServerException {
+      throws SolrServerException, IOException {
 
     if (r.nextBoolean()) params.set("collection", DEFAULT_COLLECTION);
 

Modified: lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/CloudInspectUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/CloudInspectUtil.java?rev=1662670&r1=1662669&r2=1662670&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/CloudInspectUtil.java (original)
+++ lucene/dev/trunk/solr/test-framework/src/java/org/apache/solr/cloud/CloudInspectUtil.java Fri Feb 27 12:17:51 2015
@@ -9,6 +9,7 @@ import org.apache.solr.common.params.Sol
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Map;
@@ -161,7 +162,7 @@ public class CloudInspectUtil {
    * @return true if the compared results are illegal.
    */
   public static boolean compareResults(SolrClient controlClient, SolrClient cloudClient)
-      throws SolrServerException {
+      throws SolrServerException, IOException {
     return compareResults(controlClient, cloudClient, null, null);
   }
   
@@ -171,7 +172,7 @@ public class CloudInspectUtil {
    * @return true if the compared results are illegal.
    */
   public static boolean compareResults(SolrClient controlClient, SolrClient cloudClient, Set<String> addFails, Set<String> deleteFails)
-      throws SolrServerException {
+      throws SolrServerException, IOException {
     
     SolrParams q = SolrTestCaseJ4.params("q","*:*","rows","0", "tests","checkShardConsistency(vsControl)");    // add a tag to aid in debugging via logs