dsmiley commented on code in PR #943:
URL: https://github.com/apache/solr/pull/943#discussion_r952720997
##########
solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/ZkClientClusterStateProvider.java:
##########
@@ -67,6 +72,50 @@ public ZkClientClusterStateProvider(String zkHost) {
this.zkHost = zkHost;
}
+ /**
+ * Create a ClusterState from Json. This method supports legacy configName
location
+ *
+ * @param bytes a byte array of a Json representation of a mapping from
collection name to the
+ * Json representation of a {@link DocCollection} as written by {@link
+ * ClusterState#write(JSONWriter)}. It can represent one or more
collections.
+ * @param liveNodes list of live nodes
+ * @param coll collection name
+ * @param zkClient ZK client
+ * @return the ClusterState
+ */
+ @SuppressWarnings({"unchecked"})
+ @Deprecated
+ public static ClusterState createFromJsonSupportingLegacyConfigName(
+ int version, byte[] bytes, Set<String> liveNodes, String coll,
SolrZkClient zkClient) {
+ if (bytes == null || bytes.length == 0) {
+ return new ClusterState(liveNodes, Collections.emptyMap());
+ }
+ Map<String, Object> stateMap = (Map<String, Object>) Utils.fromJSON(bytes);
Review Comment:
We can't have Utils.getJson depending on ZK. There was one such method but
it was only used in one place so we basically inlined the implementation. I
don't think @heythm wrote this code; it just moved.
I am curious about what Lift's analysis sees; I'll look closer.
##########
solr/core/src/java/org/apache/solr/logging/MDCLoggingContext.java:
##########
@@ -108,6 +108,16 @@ private static void setNodeName(String node) {
}
}
+ public static String getNodeName() {
+ String s = MDC.get(NODE_NAME_PROP);
+ if (s == null) return null;
+ if (s.startsWith("n:")) {
Review Comment:
Yes; just moved the method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]