baomingyu commented on a change in pull request #1957:
URL: https://github.com/apache/incubator-inlong/pull/1957#discussion_r767394817



##########
File path: 
inlong-audit/audit-sdk/src/main/java/org/apache/inlong/audit/AuditImp.java
##########
@@ -0,0 +1,249 @@
+/*
+ * 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.audit;
+
+import org.apache.inlong.audit.protocol.AuditApi;
+import org.apache.inlong.audit.send.SenderManager;
+import org.apache.inlong.audit.util.Config;
+import org.apache.inlong.audit.util.StatInfo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.locks.ReentrantLock;
+
+import static 
org.apache.inlong.audit.protocol.AuditApi.BaseCommand.Type.AUDITREQUEST;
+
+public class AuditImp {
+    private static final Logger logger = 
LoggerFactory.getLogger(AuditImp.class);
+    private static AuditImp auditImp = new AuditImp();
+    private static final String FIELD_SEPARATORS = ":";
+    private ConcurrentHashMap<String, StatInfo> countMap = new 
ConcurrentHashMap<String, StatInfo>();
+    private HashMap<String, StatInfo> threadSumMap = new HashMap<String, 
StatInfo>();
+    private ConcurrentHashMap<String, StatInfo> deleteCountMap = new 
ConcurrentHashMap<String, StatInfo>();
+    private List<String> deleteKeyList = new ArrayList<String>();
+    private Config config = new Config();
+    private Long sdkTime;
+    private int packageId = 1;
+    private int dataId = 0;
+    private static final int BATCH_NUM = 100;
+    boolean inited = false;
+    private SenderManager manager;
+    private static ReentrantLock globalLock = new ReentrantLock();
+    private Timer timer = new Timer();
+    private TimerTask timerTask = new TimerTask() {
+        @Override
+        public void run() {
+            try {
+                sendReport();
+            } catch (Exception e) {
+                logger.error(e.getMessage());
+            }
+        }
+    };
+
+    public static AuditImp getInstance() {
+        return auditImp;
+    }
+
+    /**
+     * init
+     */
+    private void init() {
+        if (inited) {
+            return;
+        }
+        config.init();
+        timer.schedule(timerTask, 1000 * 60, 1000 * 60);

Review comment:
       logic number '1000 * 60, 1000 * 60'




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