mqliang commented on code in PR #14536:
URL: https://github.com/apache/pinot/pull/14536#discussion_r1870301061


##########
pinot-controller/src/main/java/org/apache/pinot/controller/util/ServerInfoFetcher.java:
##########
@@ -0,0 +1,131 @@
+/**
+ * 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.pinot.controller.util;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import org.apache.helix.model.InstanceConfig;
+import org.apache.helix.zookeeper.datamodel.ZNRecord;
+import org.apache.pinot.controller.helix.core.PinotHelixResourceManager;
+import org.apache.pinot.spi.utils.CommonConstants;
+import org.apache.pinot.spi.utils.InstanceTypeUtils;
+
+
+/**
+ * This is a helper class that fetch server information from Helix/ZK. It 
caches the server information to avoid
+ * repeated ZK access. This class is NOT thread-safe.
+ */
+public class ServerInfoFetcher {

Review Comment:
   It not only contains state (helix_enabled, query_disabled, 
shutdown_in_progress), but also contains some other information (tables on that 
server, instance tags, and potentially @jasperjiaguo will add more). So I 
rename it as `ServerQueryInfoFetcher`.
   
   In addition, @jasperjiaguo will use this `ServerQueryInfoFetcher` very soon 
in his other PRs, and it's under `util` package, it's OK to be public. There 
are some other util class such as `SegmentIntervalUtils`, 
`AutoAddInvertedIndex`, they are used by only one class, but also be public.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to