You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/08/26 00:01:27 UTC

[lucene-solr] branch reference_impl updated (8d58c6a -> da04237)

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

markrmiller pushed a change to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 8d58c6a  @601 Small cleanup.
     new 5018811  Re-enable SolrZkClientTest
     new da04237  Re-enable JsonQueryRequestHeatmapFacetingTest and fix async wait issue in CloudHttp2SolrClient's doParallelUpdate impl

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../client/solrj/impl/CloudHttp2SolrClient.java    |  9 ++++----
 .../json/JsonQueryRequestHeatmapFacetingTest.java  | 26 ++++++++++++----------
 ...RequestReplicaListTransformerGeneratorTest.java |  2 --
 .../apache/solr/common/cloud/SolrZkClientTest.java |  6 ++---
 4 files changed, 21 insertions(+), 22 deletions(-)


[lucene-solr] 01/02: Re-enable SolrZkClientTest

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5018811aad83489964c8f836dea28806ad52ca21
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Fri Aug 21 16:20:38 2020 -0600

    Re-enable SolrZkClientTest
---
 .../src/test/org/apache/solr/common/cloud/SolrZkClientTest.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/solr/solrj/src/test/org/apache/solr/common/cloud/SolrZkClientTest.java b/solr/solrj/src/test/org/apache/solr/common/cloud/SolrZkClientTest.java
index 786a358..2ffd741 100644
--- a/solr/solrj/src/test/org/apache/solr/common/cloud/SolrZkClientTest.java
+++ b/solr/solrj/src/test/org/apache/solr/common/cloud/SolrZkClientTest.java
@@ -40,12 +40,10 @@ import org.apache.zookeeper.ZooDefs;
 import org.apache.zookeeper.data.ACL;
 import org.apache.zookeeper.data.Id;
 import org.apache.zookeeper.server.auth.DigestAuthenticationProvider;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-@Ignore // nocommit debug
 public class SolrZkClientTest extends SolrCloudTestCase {
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
@@ -82,7 +80,7 @@ public class SolrZkClientTest extends SolrCloudTestCase {
     }
 
     defaultClient = new SolrZkClient(zkServer.getZkAddress(), AbstractZkTestCase.TIMEOUT).start();
-    defaultClient.mkdir(PATH);
+    defaultClient.mkdirs(PATH);
 
     aclClient = new SolrZkClient(zkServer.getZkAddress(), AbstractZkTestCase.TIMEOUT) {
       @Override
@@ -121,7 +119,7 @@ public class SolrZkClientTest extends SolrCloudTestCase {
     defaultClient.close();
     zkServer.shutdown();
     solrClient.close();
-    cluster.shutdown();
+    shutdownCluster();
     super.tearDown();
   }
 


[lucene-solr] 02/02: Re-enable JsonQueryRequestHeatmapFacetingTest and fix async wait issue in CloudHttp2SolrClient's doParallelUpdate impl

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit da04237a0bc4e3e97c62c89e46940920b50c2083
Author: Timothy Potter <th...@gmail.com>
AuthorDate: Tue Aug 25 16:15:31 2020 -0600

    Re-enable JsonQueryRequestHeatmapFacetingTest and fix async wait issue in CloudHttp2SolrClient's doParallelUpdate impl
---
 .../client/solrj/impl/CloudHttp2SolrClient.java    |  9 ++++----
 .../json/JsonQueryRequestHeatmapFacetingTest.java  | 26 ++++++++++++----------
 ...RequestReplicaListTransformerGeneratorTest.java |  2 --
 3 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
index 1688937..4d45fe1 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudHttp2SolrClient.java
@@ -20,16 +20,12 @@ package org.apache.solr.client.solrj.impl;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
 
 import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.request.UpdateRequest;
 import org.apache.solr.common.ParWork;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.cloud.ZkStateReader;
@@ -99,6 +95,7 @@ public class CloudHttp2SolrClient  extends BaseCloudSolrClient {
 
   }
 
+  @Override
   protected void doParallelUpdate(Map<String,? extends LBSolrClient.Req> routes,
       NamedList<Throwable> exceptions, NamedList<NamedList> shardResponses) {
     Map<String,Throwable> tsExceptions = new ConcurrentHashMap<>();
@@ -131,6 +128,10 @@ public class CloudHttp2SolrClient  extends BaseCloudSolrClient {
         MDC.remove("CloudSolrClient.url");
       }
     }
+
+    // wait until the async requests we fired off above are done
+    myClient.waitForOutstandingRequests();
+
     exceptions.addAll(tsExceptions);
     shardResponses.addAll(tsResponses);
     if (exceptions.size() > 0) {
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/JsonQueryRequestHeatmapFacetingTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/JsonQueryRequestHeatmapFacetingTest.java
index bfd5e2a..7f54b70 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/JsonQueryRequestHeatmapFacetingTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/request/json/JsonQueryRequestHeatmapFacetingTest.java
@@ -23,18 +23,20 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 
+import org.apache.solr.client.solrj.SolrQuery;
 import org.apache.solr.client.solrj.request.CollectionAdminRequest;
 import org.apache.solr.client.solrj.response.QueryResponse;
+import org.apache.solr.client.solrj.response.UpdateResponse;
 import org.apache.solr.client.solrj.response.json.HeatmapJsonFacet;
 import org.apache.solr.client.solrj.response.json.NestableJsonFacet;
 import org.apache.solr.cloud.SolrCloudTestCase;
 import org.apache.solr.common.SolrInputDocument;
 import org.apache.solr.util.ExternalPaths;
 import org.junit.BeforeClass;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class JsonQueryRequestHeatmapFacetingTest extends SolrCloudTestCase {
+
   private static final String COLLECTION_NAME = "spatialdata";
   private static final String CONFIG_NAME = "spatialdata_config";
   private static final String FIELD = "location_srpt";
@@ -46,7 +48,7 @@ public class JsonQueryRequestHeatmapFacetingTest extends SolrCloudTestCase {
         .configure();
 
     final List<String> solrUrls = new ArrayList<>();
-    solrUrls.add(cluster.getJettySolrRunner(0).getBaseUrl().toString());
+    solrUrls.add(cluster.getJettySolrRunner(0).getBaseUrl());
 
     CollectionAdminRequest.createCollection(COLLECTION_NAME, CONFIG_NAME, 1, 1).process(cluster.getSolrClient());
 
@@ -58,20 +60,20 @@ public class JsonQueryRequestHeatmapFacetingTest extends SolrCloudTestCase {
     final SolrInputDocument doc2 = new SolrInputDocument("id", "1", FIELD, "ENVELOPE(-120, -110, 80, 20)");
     final SolrInputDocument doc3 = new SolrInputDocument("id", "3", FIELD, "POINT(70 60)");
     final SolrInputDocument doc4 = new SolrInputDocument("id", "4", FIELD, "POINT(91 89)");
-    final List<SolrInputDocument> docs = new ArrayList<>();
-    docs.add(doc1);
-    docs.add(doc2);
-    docs.add(doc3);
-    docs.add(doc4);
-
-    cluster.getSolrClient().add(COLLECTION_NAME, docs);
-    cluster.getSolrClient().commit(COLLECTION_NAME);
-  }
+    final List<SolrInputDocument> docs = Arrays.asList(doc1, doc2, doc3, doc4);
 
+    UpdateResponse updateResponse = cluster.getSolrClient().add(COLLECTION_NAME, docs);
+    assertTrue(updateResponse.getStatus() == 0);
 
+    updateResponse = cluster.getSolrClient().commit(COLLECTION_NAME);
+    assertTrue(updateResponse.getStatus() == 0);
+
+    QueryResponse queryResponse = cluster.getSolrClient().query(COLLECTION_NAME, new SolrQuery("*:*"));
+    assertTrue("Expected "+docs.size()+" docs in "+COLLECTION_NAME,
+        queryResponse.getResults().getNumFound() == docs.size());
+  }
 
   @Test
-  @Ignore // nocommit check this out
   public void testHeatmapFacet() throws Exception {
     final List<List<Integer>> expectedHeatmapGrid = Arrays.asList(
         Arrays.asList(0, 0, 2, 1, 0, 0),
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
index 0c46baa..c0ebad3 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java
@@ -25,10 +25,8 @@ import org.apache.solr.common.cloud.Replica;
 import org.apache.solr.common.cloud.ZkStateReader;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.ShardParams;
-import org.junit.Ignore;
 import org.junit.Test;
 
-@Ignore // nocommit debug
 public class RequestReplicaListTransformerGeneratorTest extends SolrTestCaseJ4 {
 
   @Test