Skip to content

Commit

Permalink
[INLONG-10633][Agent] The initialization function of AuditUtils needs…
Browse files Browse the repository at this point in the history
… to pass in the configuration (apache#10634)
  • Loading branch information
justinwwhuang authored Jul 17, 2024
1 parent 0c02cfd commit 5e9112f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.inlong.agent.metrics.audit;

import org.apache.inlong.agent.conf.AgentConfiguration;
import org.apache.inlong.agent.conf.AbstractConfiguration;
import org.apache.inlong.audit.AuditOperator;
import org.apache.inlong.audit.entity.AuditComponent;

Expand Down Expand Up @@ -59,12 +59,12 @@ public class AuditUtils {
public static int AUDIT_ID_AGENT_ADD_INSTANCE_MEM_FAILED = 1073741842;
public static int AUDIT_ID_AGENT_DEL_INSTANCE_MEM_UNUSUAL = 1073741843;
private static boolean IS_AUDIT = true;
private static AbstractConfiguration conf;

/**
* Init audit config
*/
public static void initAudit() {
AgentConfiguration conf = AgentConfiguration.getAgentConf();
public static void initAudit(AbstractConfiguration conf) {
IS_AUDIT = conf.getBoolean(AUDIT_ENABLE, DEFAULT_AUDIT_ENABLE);
if (IS_AUDIT) {
AuditOperator.getInstance().setAuditProxy(AuditComponent.AGENT, conf.get(AGENT_MANAGER_ADDR),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static void main(String[] args) throws Exception {
CommandLine cl = initOptions(args);
assert cl != null;
initAgentConf(cl);
AuditUtils.initAudit();
AuditUtils.initAudit(AgentConfiguration.getAgentConf());
AgentManager manager = new AgentManager();
try {
manager.start();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static void main(String[] args) throws Exception {
CommandLine cl = initOptions(args);
assert cl != null;
initAgentConf(cl);
AuditUtils.initAudit();
AuditUtils.initAudit(InstallerConfiguration.getInstallerConf());
Manager manager = new Manager();
try {
manager.start();
Expand Down

0 comments on commit 5e9112f

Please sign in to comment.