dockerzhang commented on code in PR #9803:
URL: https://github.com/apache/inlong/pull/9803#discussion_r1522465020


##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/conf/InstallerConfiguration.java:
##########
@@ -0,0 +1,67 @@
+/*
+ * 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.inlong.agent.installer.conf;
+
+import org.apache.inlong.agent.conf.AbstractConfiguration;
+
+import java.util.ArrayList;
+
+/**
+ * installer configuration. Only one instance in the process.
+ * Basically it use properties file to store configurations.
+ */
+public class InstallerConfiguration extends AbstractConfiguration {
+
+    public static final String DEFAULT_CONFIG_FILE = "installer.properties";
+    private static final ArrayList<String> LOCAL_RESOURCES = new ArrayList<>();
+    private static volatile InstallerConfiguration installerConf = null;
+
+    static {
+        LOCAL_RESOURCES.add(DEFAULT_CONFIG_FILE);
+    }
+
+    /**
+     * load config from file.

Review Comment:
   ```suggestion
        * Load config from file.
   ```



##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/conf/InstallerConfiguration.java:
##########
@@ -0,0 +1,67 @@
+/*
+ * 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.inlong.agent.installer.conf;
+
+import org.apache.inlong.agent.conf.AbstractConfiguration;
+
+import java.util.ArrayList;
+
+/**
+ * installer configuration. Only one instance in the process.
+ * Basically it use properties file to store configurations.
+ */
+public class InstallerConfiguration extends AbstractConfiguration {
+
+    public static final String DEFAULT_CONFIG_FILE = "installer.properties";
+    private static final ArrayList<String> LOCAL_RESOURCES = new ArrayList<>();
+    private static volatile InstallerConfiguration installerConf = null;
+
+    static {
+        LOCAL_RESOURCES.add(DEFAULT_CONFIG_FILE);
+    }
+
+    /**
+     * load config from file.
+     */
+    private InstallerConfiguration() {
+        for (String fileName : LOCAL_RESOURCES) {
+            super.loadPropertiesResource(fileName);
+        }
+    }
+
+    /**
+     * singleton for agent configuration.

Review Comment:
   ```suggestion
        * Singleton for agent configuration.
   ```



##########
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/Manager.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * 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.inlong.agent.installer;
+
+import org.apache.inlong.agent.common.AbstractDaemon;
+import org.apache.inlong.agent.conf.ProfileFetcher;
+import org.apache.inlong.agent.constant.AgentConstants;
+import org.apache.inlong.agent.core.task.TaskManager;
+import org.apache.inlong.agent.installer.conf.InstallerConfiguration;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.lang.reflect.Constructor;
+
+/**
+ * Installer Manager, the bridge for job manager, task manager, db e.t.c it 
manages agent level operations and
+ * communicates
+ * with outside system.
+ */
+public class Manager extends AbstractDaemon {
+
+    private static final Logger LOGGER = 
LoggerFactory.getLogger(Manager.class);
+    private final TaskManager taskManager;
+    private final ProfileFetcher fetcher;
+    private final InstallerConfiguration conf;
+
+    public Manager() {
+        conf = InstallerConfiguration.getInstallerConf();
+        taskManager = new TaskManager();
+        fetcher = initFetcher(this);
+    }
+
+    /**
+     * init fetch by class name

Review Comment:
   ```suggestion
        * Init fetch by class name
   ```



-- 
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]

Reply via email to