You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/01/24 08:24:53 UTC

[GitHub] [incubator-inlong] justinwwhuang commented on a change in pull request #2307: [INLONG-2297][agent]support audit for source and sink

justinwwhuang commented on a change in pull request #2307:
URL: https://github.com/apache/incubator-inlong/pull/2307#discussion_r790503060



##########
File path: inlong-agent/agent-common/src/main/java/org/apache/inlong/agent/metrics/audit/AuditUtils.java
##########
@@ -0,0 +1,90 @@
+/**
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.metrics.audit;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.inlong.agent.conf.AgentConfiguration;
+import org.apache.inlong.audit.AuditImp;
+import org.apache.inlong.audit.util.AuditConfig;
+
+import java.util.HashSet;
+
+import static org.apache.inlong.agent.constants.AgentConstants.AUDIT_ENABLE;
+import static org.apache.inlong.agent.constants.AgentConstants.DEFAULT_AUDIT_ENABLE;
+import static org.apache.inlong.agent.constants.AgentConstants.AUDIT_KEY_PROXYS;
+import static org.apache.inlong.agent.constants.AgentConstants.DEFAULT_AUDIT_PROXYS;
+
+/**
+ * AuditUtils
+ */
+public class AuditUtils {
+
+    public static final String AUDIT_KEY_FILE_PATH = "audit.filePath";
+    public static final String AUDIT_DEFAULT_FILE_PATH = "/data/inlong/audit/";
+    public static final String AUDIT_KEY_MAX_CACHE_ROWS = "audit.maxCacheRows";
+    public static final int AUDIT_DEFAULT_MAX_CACHE_ROWS = 2000000;
+    public static final int AUDIT_ID_AGENT_READ_SUCCESS = 3;
+    public static final int AUDIT_ID_AGENT_SEND_SUCCESS = 4;

Review comment:
       if enum class is needed, it would be better for audit class to doit




-- 
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-unsubscribe@inlong.apache.org

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