You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2017/10/04 08:25:11 UTC
[19/50] [abbrv] lucene-solr:master: Revert "SOLR-11285: Initial
refactoring."
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ClusterDataProvider.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ClusterDataProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ClusterDataProvider.java
index 8e77d62..58972af 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ClusterDataProvider.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/ClusterDataProvider.java
@@ -19,28 +19,12 @@ package org.apache.solr.client.solrj.cloud.autoscaling;
import java.io.Closeable;
import java.io.IOException;
-import java.net.ConnectException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
-import java.util.NoSuchElementException;
-import org.apache.http.client.HttpClient;
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrResponse;
-import org.apache.solr.client.solrj.cloud.DistributedQueue;
-import org.apache.solr.common.cloud.ClusterState;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.Op;
-import org.apache.zookeeper.OpResult;
-import org.apache.zookeeper.Watcher;
-
-/**
- * This interface abstracts the details of dealing with Zookeeper and Solr from the autoscaling framework.
- */
public interface ClusterDataProvider extends Closeable {
- /**
- * Get the value of each tag for a given node
+ /**Get the value of each tag for a given node
*
* @param node node name
* @param tags tag names
@@ -50,87 +34,19 @@ public interface ClusterDataProvider extends Closeable {
/**
* Get the details of each replica in a node. It attempts to fetch as much details about
- * the replica as mentioned in the keys list. It is not necessary to give all details
+ * the replica as mentioned in the keys list. It is not necessary to give al details
* <p>
* the format is {collection:shard :[{replicadetails}]}
*/
Map<String, Map<String, List<ReplicaInfo>>> getReplicaInfo(String node, Collection<String> keys);
- /**
- * Get the current set of live nodes.
- */
- Collection<String> getLiveNodes();
-
- ClusterState getClusterState() throws IOException;
-
- Map<String, Object> getClusterProperties();
-
- default <T> T getClusterProperty(String key, T defaultValue) {
- T value = (T) getClusterProperties().get(key);
- if (value == null)
- return defaultValue;
- return value;
- }
+ Collection<String> getNodes();
- AutoScalingConfig getAutoScalingConfig(Watcher watcher) throws ConnectException, InterruptedException, IOException;
-
- default AutoScalingConfig getAutoScalingConfig() throws ConnectException, InterruptedException, IOException {
- return getAutoScalingConfig(null);
- }
-
- /**
- * Get the collection-specific policy
+ /**Get the collection-specific policy
*/
String getPolicyNameByCollection(String coll);
@Override
default void close() throws IOException {
}
-
- // ZK-like methods
-
- boolean hasData(String path) throws IOException;
-
- List<String> listData(String path) throws NoSuchElementException, IOException;
-
- class VersionedData {
- public final int version;
- public final byte[] data;
-
- public VersionedData(int version, byte[] data) {
- this.version = version;
- this.data = data;
- }
- }
-
- VersionedData getData(String path, Watcher watcher) throws NoSuchElementException, IOException;
-
- default VersionedData getData(String path) throws NoSuchElementException, IOException {
- return getData(path, null);
- }
-
- // mutators
-
- void makePath(String path) throws IOException;
-
- void createData(String path, byte[] data, CreateMode mode) throws IOException;
-
- void removeData(String path, int version) throws NoSuchElementException, IOException;
-
- void setData(String path, byte[] data, int version) throws NoSuchElementException, IOException;
-
- List<OpResult> multi(final Iterable<Op> ops) throws IOException;
-
- // Solr-like methods
-
- SolrResponse request(SolrRequest req) throws IOException;
-
- HttpClient getHttpClient();
-
- interface DistributedQueueFactory {
- DistributedQueue makeQueue(String path) throws IOException;
- void removeQueue(String path) throws IOException;
- }
-
- DistributedQueueFactory getDistributedQueueFactory();
}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/DelegatingClusterDataProvider.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/DelegatingClusterDataProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/DelegatingClusterDataProvider.java
deleted file mode 100644
index 54f4a80..0000000
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/DelegatingClusterDataProvider.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.apache.solr.client.solrj.cloud.autoscaling;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import org.apache.http.client.HttpClient;
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrResponse;
-import org.apache.solr.common.cloud.ClusterState;
-import org.apache.zookeeper.CreateMode;
-import org.apache.zookeeper.Op;
-import org.apache.zookeeper.OpResult;
-import org.apache.zookeeper.Watcher;
-
-/**
- *
- */
-public class DelegatingClusterDataProvider implements ClusterDataProvider {
- protected ClusterDataProvider delegate;
-
- public DelegatingClusterDataProvider(ClusterDataProvider delegate) {
- this.delegate = delegate;
- }
-
- @Override
- public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
- return delegate.getNodeValues(node, tags);
- }
-
- @Override
- public Map<String, Map<String, List<ReplicaInfo>>> getReplicaInfo(String node, Collection<String> keys) {
- return delegate.getReplicaInfo(node, keys);
- }
-
- @Override
- public Collection<String> getLiveNodes() {
- return delegate.getLiveNodes();
- }
-
- @Override
- public Map<String, Object> getClusterProperties() {
- return delegate.getClusterProperties();
- }
-
- @Override
- public ClusterState getClusterState() throws IOException {
- return delegate.getClusterState();
- }
-
- @Override
- public AutoScalingConfig getAutoScalingConfig(Watcher watcher) throws ConnectException, InterruptedException, IOException {
- return delegate.getAutoScalingConfig(watcher);
- }
-
- @Override
- public String getPolicyNameByCollection(String coll) {
- return delegate.getPolicyNameByCollection(coll);
- }
-
- @Override
- public boolean hasData(String path) throws IOException {
- return delegate.hasData(path);
- }
-
- @Override
- public List<String> listData(String path) throws NoSuchElementException, IOException {
- return delegate.listData(path);
- }
-
- @Override
- public VersionedData getData(String path, Watcher watcher) throws NoSuchElementException, IOException {
- return delegate.getData(path, watcher);
- }
-
- @Override
- public void makePath(String path) throws IOException {
- delegate.makePath(path);
- }
-
- @Override
- public void createData(String path, byte[] data, CreateMode mode) throws IOException {
- delegate.createData(path, data, mode);
- }
-
- @Override
- public void removeData(String path, int version) throws NoSuchElementException, IOException {
- delegate.removeData(path, version);
- }
-
- @Override
- public void setData(String path, byte[] data, int version) throws NoSuchElementException, IOException {
- delegate.setData(path, data, version);
- }
-
- @Override
- public List<OpResult> multi(Iterable<Op> ops) throws IOException {
- return delegate.multi(ops);
- }
-
- @Override
- public SolrResponse request(SolrRequest req) throws IOException {
- return delegate.request(req);
- }
-
- @Override
- public HttpClient getHttpClient() {
- return delegate.getHttpClient();
- }
-
- @Override
- public DistributedQueueFactory getDistributedQueueFactory() {
- return delegate.getDistributedQueueFactory();
- }
-}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
index e160685..9c90e34 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Policy.java
@@ -201,7 +201,7 @@ public class Policy implements MapWriter {
}
Session(ClusterDataProvider dataProvider) {
- this.nodes = new ArrayList<>(dataProvider.getLiveNodes());
+ this.nodes = new ArrayList<>(dataProvider.getNodes());
this.dataProvider = dataProvider;
for (String node : nodes) {
collections.addAll(dataProvider.getReplicaInfo(node, Collections.emptyList()).keySet());
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/PolicyHelper.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/PolicyHelper.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/PolicyHelper.java
index da4c7de..a8c99ec 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/PolicyHelper.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/PolicyHelper.java
@@ -49,7 +49,22 @@ public class PolicyHelper {
List<String> nodesList) {
List<ReplicaPosition> positions = new ArrayList<>();
final ClusterDataProvider delegate = cdp;
- cdp = new DelegatingClusterDataProvider(delegate) {
+ cdp = new ClusterDataProvider() {
+ @Override
+ public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
+ return delegate.getNodeValues(node, tags);
+ }
+
+ @Override
+ public Map<String, Map<String, List<ReplicaInfo>>> getReplicaInfo(String node, Collection<String> keys) {
+ return delegate.getReplicaInfo(node, keys);
+ }
+
+ @Override
+ public Collection<String> getNodes() {
+ return delegate.getNodes();
+ }
+
@Override
public String getPolicyNameByCollection(String coll) {
return policyMapping.get() != null && policyMapping.get().containsKey(coll) ?
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
index fcada43..fe1121d 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/autoscaling/Row.java
@@ -46,7 +46,7 @@ public class Row implements MapWriter {
if (collectionVsShardVsReplicas == null) collectionVsShardVsReplicas = new HashMap<>();
this.node = node;
cells = new Cell[params.size()];
- isLive = dataProvider.getLiveNodes().contains(node);
+ isLive = dataProvider.getNodes().contains(node);
Map<String, Object> vals = isLive ? dataProvider.getNodeValues(node, params) : Collections.emptyMap();
for (int i = 0; i < params.size(); i++) {
String s = params.get(i);
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java
index a5ef453..d63f5f0 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/SolrClientDataProvider.java
@@ -28,15 +28,10 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import java.util.NoSuchElementException;
-import java.util.Queue;
import java.util.Set;
-import org.apache.http.client.HttpClient;
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.autoscaling.AutoScalingConfig;
import org.apache.solr.client.solrj.cloud.autoscaling.ClusterDataProvider;
import org.apache.solr.client.solrj.cloud.autoscaling.ReplicaInfo;
import org.apache.solr.client.solrj.request.GenericSolrRequest;
@@ -45,7 +40,6 @@ import org.apache.solr.common.MapWriter;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.cloud.ClusterState;
import org.apache.solr.common.cloud.DocCollection;
-import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.common.cloud.rule.ImplicitSnitch;
import org.apache.solr.common.cloud.rule.RemoteCallback;
@@ -56,12 +50,7 @@ import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.StrUtils;
import org.apache.solr.common.util.Utils;
-import org.apache.zookeeper.CreateMode;
import org.apache.zookeeper.KeeperException;
-import org.apache.zookeeper.Op;
-import org.apache.zookeeper.OpResult;
-import org.apache.zookeeper.Watcher;
-import org.apache.zookeeper.data.Stat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -74,19 +63,16 @@ public class SolrClientDataProvider implements ClusterDataProvider, MapWriter {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private final CloudSolrClient solrClient;
- private final DistributedQueueFactory queueFactory;
- private final ZkStateReader zkStateReader;
- private final SolrZkClient zkClient;
private final Map<String, Map<String, Map<String, List<ReplicaInfo>>>> data = new HashMap<>();
+ private Set<String> liveNodes;
private Map<String, Object> snitchSession = new HashMap<>();
private Map<String, Map> nodeVsTags = new HashMap<>();
- public SolrClientDataProvider(DistributedQueueFactory queueFactory, CloudSolrClient solrClient) {
- this.queueFactory = queueFactory;
+ public SolrClientDataProvider(CloudSolrClient solrClient) {
this.solrClient = solrClient;
- this.zkStateReader = solrClient.getZkStateReader();
- this.zkClient = zkStateReader.getZkClient();
+ ZkStateReader zkStateReader = solrClient.getZkStateReader();
ClusterState clusterState = zkStateReader.getClusterState();
+ this.liveNodes = clusterState.getLiveNodes();
Map<String, ClusterState.CollectionRef> all = clusterState.getCollectionStates();
all.forEach((collName, ref) -> {
DocCollection coll = ref.get();
@@ -121,135 +107,16 @@ public class SolrClientDataProvider implements ClusterDataProvider, MapWriter {
}
@Override
- public Collection<String> getLiveNodes() {
- return solrClient.getZkStateReader().getClusterState().getLiveNodes();
+ public Collection<String> getNodes() {
+ return liveNodes;
}
@Override
public void writeMap(EntryWriter ew) throws IOException {
- ew.put("liveNodes", zkStateReader.getClusterState().getLiveNodes());
+ ew.put("liveNodes", liveNodes);
ew.put("replicaInfo", Utils.getDeepCopy(data, 5));
ew.put("nodeValues", nodeVsTags);
- }
-
- @Override
- public Map<String, Object> getClusterProperties() {
- return zkStateReader.getClusterProperties();
- }
-
- @Override
- public ClusterState getClusterState() {
- return zkStateReader.getClusterState();
- }
-
- @Override
- public AutoScalingConfig getAutoScalingConfig(Watcher watcher) throws IOException {
- try {
- return zkStateReader.getAutoScalingConfig(watcher);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public boolean hasData(String path) throws IOException {
- try {
- return zkClient.exists(path, true);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
- @Override
- public List<String> listData(String path) throws NoSuchElementException, IOException {
- try {
- return zkClient.getChildren(path, null, true);
- } catch (KeeperException.NoNodeException e) {
- throw new NoSuchElementException(path);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public VersionedData getData(String path, Watcher watcher) throws NoSuchElementException, IOException {
- Stat stat = new Stat();
- try {
- byte[] bytes = zkClient.getData(path, watcher, stat, true);
- return new VersionedData(stat.getVersion(), bytes);
- } catch (KeeperException.NoNodeException e) {
- throw new NoSuchElementException(path);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public void makePath(String path) throws IOException {
- try {
- zkClient.makePath(path, true);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public void createData(String path, byte[] data, CreateMode mode) throws IOException {
- try {
- zkClient.create(path, data, mode, true);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public void removeData(String path, int version) throws NoSuchElementException, IOException {
- try {
- zkClient.delete(path, version, true);
- } catch (KeeperException.NoNodeException e) {
- throw new NoSuchElementException(path);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public void setData(String path, byte[] data, int version) throws NoSuchElementException, IOException {
- try {
- zkClient.setData(path, data, version, true);
- } catch (KeeperException.NoNodeException e) {
- throw new NoSuchElementException(path);
- } catch (KeeperException | InterruptedException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public SolrResponse request(SolrRequest req) throws IOException {
- try {
- return req.process(solrClient);
- } catch (SolrServerException e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public List<OpResult> multi(Iterable<Op> ops) throws IOException {
- try {
- return zkClient.multi(ops, true);
- } catch (Exception e) {
- throw new IOException(e);
- }
- }
-
- @Override
- public HttpClient getHttpClient() {
- return solrClient.getHttpClient();
- }
-
- @Override
- public DistributedQueueFactory getDistributedQueueFactory() {
- return queueFactory;
}
static class ClientSnitchCtx
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/ce7db65e/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java b/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
index 4d75795..a11eab4 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/cloud/autoscaling/TestPolicy.java
@@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import com.google.common.collect.ImmutableList;
import org.apache.solr.SolrTestCaseJ4;
@@ -421,7 +422,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
});
});
- return new DelegatingClusterDataProvider(null) {
+ return new ClusterDataProvider(){
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
return (Map<String, Object>) Utils.getObjectByPath(m,false, Arrays.asList("nodeValues", node));
@@ -433,7 +434,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
+ public Collection<String> getNodes() {
return (Collection<String>) m.get("liveNodes");
}
@@ -962,7 +963,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
Policy policy = new Policy((Map<String, Object>) Utils.fromJSONString(autoscaleJson));
ClusterDataProvider clusterDataProvider = getClusterDataProvider(nodeValues, clusterState);
- ClusterDataProvider cdp = new DelegatingClusterDataProvider(null) {
+ ClusterDataProvider cdp = new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
return clusterDataProvider.getNodeValues(node, tags);
@@ -974,8 +975,8 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
- return clusterDataProvider.getLiveNodes();
+ public Collection<String> getNodes() {
+ return clusterDataProvider.getNodes();
}
@Override
@@ -1040,7 +1041,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
" 'freedisk':918005641216}}}");
Policy policy = new Policy((Map<String, Object>) Utils.fromJSONString(autoscaleJson));
- Policy.Session session = policy.createSession(new DelegatingClusterDataProvider(null) {
+ Policy.Session session = policy.createSession(new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
return tagsMap.get(node);
@@ -1052,7 +1053,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
+ public Collection<String> getNodes() {
return replicaInfoMap.keySet();
}
@@ -1098,7 +1099,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
"}");
Policy policy = new Policy((Map<String, Object>) Utils.fromJSONString(rules));
ClusterDataProvider clusterDataProvider = getClusterDataProvider(nodeValues, clusterState);
- ClusterDataProvider cdp = new DelegatingClusterDataProvider(null) {
+ ClusterDataProvider cdp = new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
return clusterDataProvider.getNodeValues(node, tags);
@@ -1110,8 +1111,8 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
- return clusterDataProvider.getLiveNodes();
+ public Collection<String> getNodes() {
+ return clusterDataProvider.getNodes();
}
@Override
@@ -1130,7 +1131,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
private ClusterDataProvider getClusterDataProvider(final Map<String, Map> nodeValues, String clusterState) {
- return new DelegatingClusterDataProvider(null) {
+ return new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> tags) {
Map<String, Object> result = new LinkedHashMap<>();
@@ -1139,7 +1140,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
+ public Collection<String> getNodes() {
return nodeValues.keySet();
}
@@ -1167,7 +1168,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
" '127.0.0.1:50096_solr':{" +
" 'cores':0," +
" 'port':'50096'}}");
- ClusterDataProvider dataProvider = new DelegatingClusterDataProvider(null) {
+ ClusterDataProvider dataProvider = new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> keys) {
Map<String, Object> result = new LinkedHashMap<>();
@@ -1186,7 +1187,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
+ public Collection<String> getNodes() {
return Arrays.asList( "127.0.0.1:50097_solr", "127.0.0.1:50096_solr");
}
};
@@ -1224,7 +1225,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
"node4:{cores:0, freedisk: 900, heap:16900, nodeRole:overseer, sysprop.rack:rack2}" +
"}");
- ClusterDataProvider dataProvider = new DelegatingClusterDataProvider(null) {
+ ClusterDataProvider dataProvider = new ClusterDataProvider() {
@Override
public Map<String, Object> getNodeValues(String node, Collection<String> keys) {
Map<String, Object> result = new LinkedHashMap<>();
@@ -1243,7 +1244,7 @@ public class TestPolicy extends SolrTestCaseJ4 {
}
@Override
- public Collection<String> getLiveNodes() {
+ public Collection<String> getNodes() {
return Arrays.asList("node1", "node2", "node3", "node4");
}
};