Technoboy- commented on a change in pull request #1537: refactor zk client and zk config module URL: https://github.com/apache/incubator-dolphinscheduler/pull/1537#discussion_r360910371
########## File path: dolphinscheduler-common/src/main/java/org/apache/dolphinscheduler/common/zk/ZookeeperCachedOperator.java ########## @@ -0,0 +1,82 @@ +/* + * 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.dolphinscheduler.common.zk; + +import org.apache.curator.framework.recipes.cache.ChildData; +import org.apache.curator.framework.recipes.cache.TreeCache; +import org.apache.curator.framework.recipes.cache.TreeCacheListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.ConcurrentHashMap; + +import static org.apache.dolphinscheduler.common.utils.Preconditions.*; +import static org.apache.dolphinscheduler.common.utils.Preconditions.checkNotNull; + +@Component +public class ZookeeperCachedOperator extends ZookeeperOperator { + + private final Logger logger = LoggerFactory.getLogger(ZookeeperCachedOperator.class); + + //kay is zk path, value is TreeCache + private ConcurrentHashMap<String, TreeCache> allCaches = new ConcurrentHashMap<>(); + + /** + * @param cachePath zk path + * @param listener operator + */ + public void registerListener(final String cachePath, final TreeCacheListener listener) { Review comment: not a good way here listen a base path is why AbstractListener borns ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services