You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "doleyzi (via GitHub)" <gi...@apache.org> on 2024/04/02 07:55:35 UTC

[PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

doleyzi opened a new pull request, #9919:
URL: https://github.com/apache/inlong/pull/9919

   ### Prepare a Pull Request
   - Fixes #9918
   ### Motivation
   
   *Audit-service add codes of config*
   
   ### Modifications
   
   *Audit-service add codes of config.*


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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "justinwwhuang (via GitHub)" <gi...@apache.org>.
justinwwhuang commented on code in PR #9919:
URL: https://github.com/apache/inlong/pull/9919#discussion_r1547414292


##########
inlong-audit/audit-service/src/main/java/source/SourceStat.java:
##########
@@ -0,0 +1,30 @@
+/*
+ * 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 source;
+
+/**
+ * Source stat interface.
+ */
+public interface SourceStat extends Runnable {
+
+    public void statByStep();
+
+    public void aggregate(String auditId);
+
+    public void doAggregate(String startTime, String endTime, String auditId);

Review Comment:
   doAggregate seems like an inner function



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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "doleyzi (via GitHub)" <gi...@apache.org>.
doleyzi commented on code in PR #9919:
URL: https://github.com/apache/inlong/pull/9919#discussion_r1547470779


##########
inlong-audit/audit-service/src/main/java/source/SourceStat.java:
##########
@@ -0,0 +1,30 @@
+/*
+ * 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 source;
+
+/**
+ * Source stat interface.
+ */
+public interface SourceStat extends Runnable {
+
+    public void statByStep();
+
+    public void aggregate(String auditId);
+
+    public void doAggregate(String startTime, String endTime, String auditId);

Review Comment:
   yes, it has been changed to a better 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: commits-unsubscribe@inlong.apache.org

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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "gosonzhang (via GitHub)" <gi...@apache.org>.
gosonzhang merged PR #9919:
URL: https://github.com/apache/inlong/pull/9919


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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9919:
URL: https://github.com/apache/inlong/pull/9919#discussion_r1547487311


##########
inlong-audit/audit-service/src/main/java/channel/DataQueue.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 channel;
+
+import entities.StatData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Data queue. use in source and sink.
+ */
+public class DataQueue {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DataQueue.class);
+
+    private final LinkedBlockingQueue<StatData> queue;
+
+    public DataQueue(int capacity) {
+        queue = new LinkedBlockingQueue<>(capacity);
+    }
+
+    /**
+     *  Push data
+     * @param statDataPo
+     */
+    public void push(StatData statDataPo) {
+        try {
+            queue.put(statDataPo);
+        } catch (InterruptedException e) {

Review Comment:
   why handle InterruptedException and just throw a RuntimeException?



##########
inlong-audit/audit-service/src/main/java/channel/DataQueue.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 channel;
+
+import entities.StatData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Data queue. use in source and sink.
+ */
+public class DataQueue {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DataQueue.class);
+
+    private final LinkedBlockingQueue<StatData> queue;
+
+    public DataQueue(int capacity) {
+        queue = new LinkedBlockingQueue<>(capacity);
+    }
+
+    /**
+     *  Push data
+     * @param statDataPo
+     */
+    public void push(StatData statDataPo) {
+        try {
+            queue.put(statDataPo);
+        } catch (InterruptedException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+    /**
+     * Pull data
+     * @param timeout
+     * @param unit
+     * @return
+     */
+    public StatData pull(long timeout, TimeUnit unit) {
+        try {
+            StatData message = queue.poll(timeout, unit);
+            return message;
+        } catch (InterruptedException ex) {

Review Comment:
   ditto here.



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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
aloyszhang commented on code in PR #9919:
URL: https://github.com/apache/inlong/pull/9919#discussion_r1547487311


##########
inlong-audit/audit-service/src/main/java/channel/DataQueue.java:
##########
@@ -0,0 +1,76 @@
+/*
+ * 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 channel;
+
+import entities.StatData;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Data queue. use in source and sink.
+ */
+public class DataQueue {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DataQueue.class);
+
+    private final LinkedBlockingQueue<StatData> queue;
+
+    public DataQueue(int capacity) {
+        queue = new LinkedBlockingQueue<>(capacity);
+    }
+
+    /**
+     *  Push data
+     * @param statDataPo
+     */
+    public void push(StatData statDataPo) {
+        try {
+            queue.put(statDataPo);
+        } catch (InterruptedException e) {

Review Comment:
   why handle InterruptedException and then throw a RuntimeException?



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


Re: [PR] [INLONG-9918][Audit] Audit-service add codes of config [inlong]

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng commented on code in PR #9919:
URL: https://github.com/apache/inlong/pull/9919#discussion_r1547343183


##########
inlong-audit/audit-service/src/main/java/config/ConfigConstants.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 config;
+
+/**
+ * Config constants
+ */
+public class ConfigConstants {
+
+    // Source config
+    public static final String CLICKHOUSE_DRIVER = "clickhouse.driver";

Review Comment:
   KEY_CLICKHOUSE_DRIVER ?



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