You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2021/06/03 06:38:26 UTC

[GitHub] [dolphinscheduler] CalvinKirs commented on a change in pull request #5562: [WIP][Feature][Registry]Registry-SPI

CalvinKirs commented on a change in pull request #5562:
URL: https://github.com/apache/dolphinscheduler/pull/5562#discussion_r644524146



##########
File path: dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/registry/RegistryCenter.java
##########
@@ -0,0 +1,257 @@
+/*
+ * 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.service.registry;
+
+import static org.apache.dolphinscheduler.common.Constants.REGISTRY_DOLPHINSCHEDULER_DEAD_SERVERS;
+
+import org.apache.dolphinscheduler.common.IStoppable;
+import org.apache.dolphinscheduler.common.utils.PropertyUtils;
+import org.apache.dolphinscheduler.common.utils.StringUtils;
+import org.apache.dolphinscheduler.spi.plugin.DolphinPluginLoader;
+import org.apache.dolphinscheduler.spi.plugin.DolphinPluginManagerConfig;
+import org.apache.dolphinscheduler.spi.register.Registry;
+import org.apache.dolphinscheduler.spi.register.RegistryException;
+import org.apache.dolphinscheduler.spi.register.RegistryPluginManager;
+import org.apache.dolphinscheduler.spi.register.SubscribeListener;
+
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.ImmutableList;
+
+/**
+ * All business parties use this class to access the registry
+ */
+public class RegistryCenter {
+
+    private static final Logger logger = LoggerFactory.getLogger(RegistryCenter.class);
+
+    private final AtomicBoolean isStarted = new AtomicBoolean(false);
+
+    private Registry registry;
+
+    private IStoppable stoppable;
+
+    /**
+     * nodes namespace
+     */
+    protected static String NODES;
+
+    /**
+     * master path
+     */
+    protected static String MASTER_PATH = "/nodes/master";
+
+    private RegistryPluginManager registryPluginManager;
+    /**
+     * worker path
+     */
+    protected static String WORKER_PATH = "/nodes/worker";
+
+    protected static final String EMPTY = "";
+
+    private static final String REGISTRY_PREFIX = "registry";
+
+    private static final String REGISTRY_PLUGIN_BINDING = "registry.plugin.binding";
+
+    private static final String REGISTRY_PLUGIN_DIR = "registry.plugin.dir";
+
+    private static final String MAVEN_LOCAL_REPOSITORY = "maven.local.repository";
+
+    private static final String REGISTRY_PLUGIN_NAME = "registry.plugin.name";
+
+    /**
+     * default registry plugin dir
+     */
+    private static final String REGISTRY_PLUGIN_PATH = "lib/plugin/registry";
+
+    /**
+     * init node persist
+     */
+    public void init() {

Review comment:
       This is handed over to alert for initialization. Currently, this PR is still in WIP status. When finished, I will modify the status.




-- 
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:
users@infra.apache.org