lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From va...@apache.org
Subject lucene-solr git commit: SOLR-8780: Remove unused OverseerCollectionMessageHandler#getClusterStatus method
Date Thu, 03 Mar 2016 12:07:23 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 682b17960 -> b440a1deb


SOLR-8780: Remove unused OverseerCollectionMessageHandler#getClusterStatus method


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b440a1de
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b440a1de
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b440a1de

Branch: refs/heads/master
Commit: b440a1deb3f129bcb09d610efa48468d648fc7f0
Parents: 682b179
Author: Varun Thacker <varunthacker1989@gmail.com>
Authored: Thu Mar 3 16:31:10 2016 +0530
Committer: Varun Thacker <varunthacker1989@gmail.com>
Committed: Thu Mar 3 17:37:07 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                |   2 +
 .../cloud/OverseerCollectionMessageHandler.java | 108 -------------------
 2 files changed, 2 insertions(+), 108 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b440a1de/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 1b9d8eb..a151971 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -361,6 +361,8 @@ Other Changes
   
 * SOLR-8764: Remove all deprecated methods and classes from master prior to the 6.0 release.
(Steve Rowe)
 
+* SOLR-8780: Remove unused OverseerCollectionMessageHandler#getClusterStatus method. (Varun
Thacker)
+
 ==================  5.5.1 ==================
 
 Bug Fixes

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b440a1de/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
index 401409a..2f7a14e 100644
--- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
+++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionMessageHandler.java
@@ -451,114 +451,6 @@ public class OverseerCollectionMessageHandler implements OverseerMessageHandler
 
   }
 
-  @SuppressWarnings("unchecked")
-  private void getClusterStatus(ClusterState clusterState, ZkNodeProps message, NamedList
results) throws KeeperException, InterruptedException {
-    String collection = message.getStr(ZkStateReader.COLLECTION_PROP);
-
-    // read aliases
-    Aliases aliases = zkStateReader.getAliases();
-    Map<String, List<String>> collectionVsAliases = new HashMap<>();
-    Map<String, String> aliasVsCollections = aliases.getCollectionAliasMap();
-    if (aliasVsCollections != null) {
-      for (Map.Entry<String, String> entry : aliasVsCollections.entrySet()) {
-        List<String> colls = StrUtils.splitSmart(entry.getValue(), ',');
-        String alias = entry.getKey();
-        for (String coll : colls) {
-          if (collection == null || collection.equals(coll))  {
-            List<String> list = collectionVsAliases.get(coll);
-            if (list == null) {
-              list = new ArrayList<>();
-              collectionVsAliases.put(coll, list);
-            }
-            list.add(alias);
-          }
-        }
-      }
-    }
-
-    Map roles = null;
-    if (zkStateReader.getZkClient().exists(ZkStateReader.ROLES, true)) {
-      roles = (Map) Utils.fromJSON(zkStateReader.getZkClient().getData(ZkStateReader.ROLES,
null, null, true));
-    }
-
-    // convert cluster state into a map of writable types
-    byte[] bytes = Utils.toJSON(clusterState);
-    Map<String, Object> stateMap = (Map<String,Object>) Utils.fromJSON(bytes);
-
-    Set<String> collections = new HashSet<>();
-    String routeKey = message.getStr(ShardParams._ROUTE_);
-    String shard = message.getStr(ZkStateReader.SHARD_ID_PROP);
-    if (collection == null) {
-      collections = new HashSet<>(clusterState.getCollections());
-    } else  {
-      collections = Collections.singleton(collection);
-    }
-
-    NamedList<Object> collectionProps = new SimpleOrderedMap<Object>();
-
-    for (String name : collections) {
-      Map<String, Object> collectionStatus = null;
-      DocCollection clusterStateCollection = clusterState.getCollection(name);
-
-      Set<String> requestedShards = new HashSet<>();
-      if (routeKey != null) {
-        DocRouter router = clusterStateCollection.getRouter();
-        Collection<Slice> slices = router.getSearchSlices(routeKey, null, clusterStateCollection);
-        for (Slice slice : slices) {
-          requestedShards.add(slice.getName());
-        }
-      }
-      if (shard != null) {
-        requestedShards.add(shard);
-      }
-
-      if (clusterStateCollection.getStateFormat() > 1) {
-        bytes = Utils.toJSON(clusterStateCollection);
-        Map<String, Object> docCollection = (Map<String, Object>) Utils.fromJSON(bytes);
-        collectionStatus = getCollectionStatus(docCollection, name, requestedShards);
-      } else {
-        collectionStatus = getCollectionStatus((Map<String, Object>) stateMap.get(name),
name, requestedShards);
-      }
-
-      collectionStatus.put("znodeVersion", clusterStateCollection.getZNodeVersion());
-      if (collectionVsAliases.containsKey(name) && !collectionVsAliases.get(name).isEmpty())
{
-        collectionStatus.put("aliases", collectionVsAliases.get(name));
-      }
-      String configName = zkStateReader.readConfigName(name);
-      collectionStatus.put("configName", configName);
-      collectionProps.add(name, collectionStatus);
-    }
-
-    List<String> liveNodes = zkStateReader.getZkClient().getChildren(ZkStateReader.LIVE_NODES_ZKNODE,
null, true);
-
-    // now we need to walk the collectionProps tree to cross-check replica state with live
nodes
-    crossCheckReplicaStateWithLiveNodes(liveNodes, collectionProps);
-
-    NamedList<Object> clusterStatus = new SimpleOrderedMap<>();
-    clusterStatus.add("collections", collectionProps);
-
-    // read cluster properties
-    Map clusterProps = zkStateReader.getClusterProps();
-    if (clusterProps != null && !clusterProps.isEmpty())  {
-      clusterStatus.add("properties", clusterProps);
-    }
-
-    // add the alias map too
-    if (aliasVsCollections != null && !aliasVsCollections.isEmpty())  {
-      clusterStatus.add("aliases", aliasVsCollections);
-    }
-
-    // add the roles map
-    if (roles != null)  {
-      clusterStatus.add("roles", roles);
-    }
-
-    // add live_nodes
-    clusterStatus.add("live_nodes", liveNodes);
-
-    results.add("cluster", clusterStatus);
-  }
-
   /**
    * Walks the tree of collection status to verify that any replicas not reporting a "down"
status is
    * on a live node, if any replicas reporting their status as "active" but the node is not
live is


Mime
View raw message