Apache Solr open-source search software
Remove DistributedQueueFactory (#1732)
David Smiley0a921cf69084
diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkController.java b/solr/core/src/java/org/apache/solr/cloud/ZkController.javaindex 4ef67664773..d8c3703957c 100644--- a/solr/core/src/java/org/apache/solr/cloud/ZkController.java+++ b/solr/core/src/java/org/apache/solr/cloud/ZkController.java@@ -875,9 +875,7 @@ public class ZkController implements Closeable {.withConnectionTimeout(15000, TimeUnit.MILLISECONDS).withSocketTimeout(30000, TimeUnit.MILLISECONDS).build();- cloudManager =- new SolrClientCloudManager(- new ZkDistributedQueueFactory(zkClient), cloudSolrClient, cc.getObjectCache());+ cloudManager = new SolrClientCloudManager(cloudSolrClient, cc.getObjectCache());cloudManager.getClusterStateProvider().connect();}return cloudManager;diff --git a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueueFactory.java b/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueueFactory.javadeleted file mode 100644index 50cdc3bd1f8..00000000000--- a/solr/core/src/java/org/apache/solr/cloud/ZkDistributedQueueFactory.java+++ /dev/null@@ -1,39 +0,0 @@-/*- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */-package org.apache.solr.cloud;--import java.io.IOException;-import org.apache.solr.client.solrj.cloud.DistributedQueue;-import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;-import org.apache.solr.common.cloud.SolrZkClient;--/** Implementation of {@link DistributedQueueFactory} that uses ZooKeeper. */-public class ZkDistributedQueueFactory implements DistributedQueueFactory {- private final SolrZkClient zkClient;-- public ZkDistributedQueueFactory(SolrZkClient zkClient) {- this.zkClient = zkClient;- }-- @Override- public DistributedQueue makeQueue(String path) throws IOException {- return new ZkDistributedQueue(zkClient, path);- }-- @Override- public void removeQueue(String path) throws IOException {}-}diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.javaindex 806e567ce51..146f7d722a5 100644--- a/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java+++ b/solr/core/src/test/org/apache/solr/cloud/OverseerTest.java@@ -1936,19 +1936,18 @@ public class OverseerTest extends SolrTestCaseJ4 {when(zkController.getLeaderProps(anyString(), anyString(), anyInt())).thenCallRealMethod();when(zkController.getLeaderProps(anyString(), anyString(), anyInt(), anyBoolean())).thenCallRealMethod();- doReturn(getCloudDataProvider(zkAddress, zkClient)).when(zkController).getSolrCloudManager();+ doReturn(getCloudDataProvider(zkAddress)).when(zkController).getSolrCloudManager();return zkController;}- private SolrCloudManager getCloudDataProvider(String zkAddress, SolrZkClient zkClient) {+ private SolrCloudManager getCloudDataProvider(String zkAddress) {var client =new CloudLegacySolrClient.Builder(Collections.singletonList(zkAddress), Optional.empty()).withSocketTimeout(30000, TimeUnit.MILLISECONDS).withConnectionTimeout(15000, TimeUnit.MILLISECONDS).build();solrClients.add(client);- SolrClientCloudManager sccm =- new SolrClientCloudManager(new ZkDistributedQueueFactory(zkClient), client);+ SolrClientCloudManager sccm = new SolrClientCloudManager(client);sccm.getClusterStateProvider().connect();return sccm;}diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.javaindex a8039fd95cf..cc8c265692f 100644--- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DelegatingCloudManager.java@@ -49,11 +49,6 @@ public class DelegatingCloudManager implements SolrCloudManager {return delegate.getDistribStateManager();}- @Override- public DistributedQueueFactory getDistributedQueueFactory() {- return delegate.getDistributedQueueFactory();- }-@Overridepublic ObjectCache getObjectCache() {return delegate == null ? objectCache : delegate.getObjectCache();diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistributedQueueFactory.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistributedQueueFactory.javadeleted file mode 100644index bd5244a6080..00000000000--- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistributedQueueFactory.java+++ /dev/null@@ -1,26 +0,0 @@-/*- * Licensed to the Apache Software Foundation (ASF) under one or more- * contributor license agreements. See the NOTICE file distributed with- * this work for additional information regarding copyright ownership.- * The ASF licenses this file to You under the Apache License, Version 2.0- * (the "License"); you may not use this file except in compliance with- * the License. You may obtain a copy of the License at- *- * http://www.apache.org/licenses/LICENSE-2.0- *- * Unless required by applicable law or agreed to in writing, software- * distributed under the License is distributed on an "AS IS" BASIS,- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- * See the License for the specific language governing permissions and- * limitations under the License.- */-package org.apache.solr.client.solrj.cloud;--import java.io.IOException;--/** */-public interface DistributedQueueFactory {- DistributedQueue makeQueue(String path) throws IOException;-- void removeQueue(String path) throws IOException;-}diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.javaindex 3c5e5d87346..f169bbc3443 100644--- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/SolrCloudManager.java@@ -46,8 +46,6 @@ public interface SolrCloudManager extends SolrCloseable {DistribStateManager getDistribStateManager();- DistributedQueueFactory getDistributedQueueFactory();-ObjectCache getObjectCache();TimeSource getTimeSource();diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.javaindex 7a58a80bc9f..b7645a9a671 100644--- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/SolrClientCloudManager.java@@ -36,7 +36,6 @@ import org.apache.solr.client.solrj.SolrRequest;import org.apache.solr.client.solrj.SolrResponse;import org.apache.solr.client.solrj.SolrServerException;import org.apache.solr.client.solrj.cloud.DistribStateManager;-import org.apache.solr.client.solrj.cloud.DistributedQueueFactory;import org.apache.solr.client.solrj.cloud.NodeStateProvider;import org.apache.solr.client.solrj.cloud.SolrCloudManager;import org.apache.solr.common.cloud.SolrZkClient;@@ -53,23 +52,17 @@ public class SolrClientCloudManager implements SolrCloudManager {protected final CloudLegacySolrClient solrClient;private final ZkDistribStateManager stateManager;- private final DistributedQueueFactory queueFactory;private final ZkStateReader zkStateReader;private final SolrZkClient zkClient;private final ObjectCache objectCache;private final boolean closeObjectCache;private volatile boolean isClosed;- public SolrClientCloudManager(- DistributedQueueFactory queueFactory, CloudLegacySolrClient solrClient) {- this(queueFactory, solrClient, null);+ public SolrClientCloudManager(CloudLegacySolrClient solrClient) {+ this(solrClient, null);}- public SolrClientCloudManager(- DistributedQueueFactory queueFactory,- CloudLegacySolrClient solrClient,- ObjectCache objectCache) {- this.queueFactory = queueFactory;+ public SolrClientCloudManager(CloudLegacySolrClient solrClient, ObjectCache objectCache) {this.solrClient = solrClient;this.zkStateReader = ZkStateReader.from(solrClient);this.zkClient = zkStateReader.getZkClient();@@ -198,9 +191,4 @@ public class SolrClientCloudManager implements SolrCloudManager {public SolrZkClient getZkClient() {return zkClient;}-- @Override- public DistributedQueueFactory getDistributedQueueFactory() {- return queueFactory;- }}