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/08/10 04:03:01 UTC

[GitHub] [inlong] Oneal65 opened a new pull request, #5449: [INLONG-5446][Sort]Add reporting metric from JDBC to audit SDK and refactor according to…

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

   
   - Fixes #5446 
   
   ### Motivation
   
   Add reporting metric from JDBC to audit SDK and refactor according to connector-base
   
   ### Modifications
   
   JDBC connector
   


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


[GitHub] [inlong] gong commented on a diff in pull request #5449: [INLONG-5446][Sort] Add reporting metric from JDBC to audit SDK and refactor according to…

Posted by GitBox <gi...@apache.org>.
gong commented on code in PR #5449:
URL: https://github.com/apache/inlong/pull/5449#discussion_r942060688


##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcBatchingOutputFormat.java:
##########
@@ -120,20 +131,29 @@ static JdbcStatementBuilder<Row> createRowJdbcStatementBuilder(int[] types) {
     public void open(int taskNumber, int numTasks) throws IOException {
         super.open(taskNumber, numTasks);
         this.runtimeContext = getRuntimeContext();
-        metricData = new MetricData(runtimeContext.getMetricGroup());
+        sinkMetricData = new SinkMetricData(runtimeContext.getMetricGroup());
         if (inLongMetric != null && !inLongMetric.isEmpty()) {
-            String[] inLongMetricArray = inLongMetric.split("&");
-            String groupId = inLongMetricArray[0];
-            String streamId = inLongMetricArray[1];
+            String[] inLongMetricArray = inLongMetric.split(DELIMITER);
+            inLongGroupId = inLongMetricArray[0];
+            inLongStreamId = inLongMetricArray[1];
             String nodeId = inLongMetricArray[2];
-            metricData.registerMetricsForDirtyBytes(groupId, streamId, nodeId, "dirtyBytes");
-            metricData.registerMetricsForDirtyRecords(groupId, streamId, nodeId, "dirtyRecords");
-            metricData.registerMetricsForNumBytesOut(groupId, streamId, nodeId, "numBytesOut");
-            metricData.registerMetricsForNumRecordsOut(groupId, streamId, nodeId, "numRecordsOut");
-            metricData.registerMetricsForNumBytesOutPerSecond(groupId, streamId, nodeId, "numBytesOutPerSecond");
-            metricData.registerMetricsForNumRecordsOutPerSecond(groupId, streamId, nodeId,
+            sinkMetricData.registerMetricsForDirtyBytes(inLongGroupId, inLongStreamId,
+                    nodeId, "dirtyBytes");
+            sinkMetricData.registerMetricsForDirtyRecords(inLongGroupId, inLongStreamId,
+                    nodeId, "dirtyRecords");
+            sinkMetricData.registerMetricsForNumBytesOut(inLongGroupId, inLongStreamId,
+                    nodeId, "numBytesOut");
+            sinkMetricData.registerMetricsForNumRecordsOut(inLongGroupId, inLongStreamId,
+                    nodeId, "numRecordsOut");
+            sinkMetricData.registerMetricsForNumBytesOutPerSecond(inLongGroupId, inLongStreamId, nodeId,
+                    "numBytesOutPerSecond");
+            sinkMetricData.registerMetricsForNumRecordsOutPerSecond(inLongGroupId, inLongStreamId, nodeId,

Review Comment:
   maybe use connector-base string of Constans class



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


[GitHub] [inlong] Oneal65 commented on a diff in pull request #5449: [INLONG-5446][Sort] Add reporting metric from JDBC to audit SDK and refactor according to…

Posted by GitBox <gi...@apache.org>.
Oneal65 commented on code in PR #5449:
URL: https://github.com/apache/inlong/pull/5449#discussion_r942064420


##########
inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/internal/JdbcBatchingOutputFormat.java:
##########
@@ -120,20 +131,29 @@ static JdbcStatementBuilder<Row> createRowJdbcStatementBuilder(int[] types) {
     public void open(int taskNumber, int numTasks) throws IOException {
         super.open(taskNumber, numTasks);
         this.runtimeContext = getRuntimeContext();
-        metricData = new MetricData(runtimeContext.getMetricGroup());
+        sinkMetricData = new SinkMetricData(runtimeContext.getMetricGroup());
         if (inLongMetric != null && !inLongMetric.isEmpty()) {
-            String[] inLongMetricArray = inLongMetric.split("&");
-            String groupId = inLongMetricArray[0];
-            String streamId = inLongMetricArray[1];
+            String[] inLongMetricArray = inLongMetric.split(DELIMITER);
+            inLongGroupId = inLongMetricArray[0];
+            inLongStreamId = inLongMetricArray[1];
             String nodeId = inLongMetricArray[2];
-            metricData.registerMetricsForDirtyBytes(groupId, streamId, nodeId, "dirtyBytes");
-            metricData.registerMetricsForDirtyRecords(groupId, streamId, nodeId, "dirtyRecords");
-            metricData.registerMetricsForNumBytesOut(groupId, streamId, nodeId, "numBytesOut");
-            metricData.registerMetricsForNumRecordsOut(groupId, streamId, nodeId, "numRecordsOut");
-            metricData.registerMetricsForNumBytesOutPerSecond(groupId, streamId, nodeId, "numBytesOutPerSecond");
-            metricData.registerMetricsForNumRecordsOutPerSecond(groupId, streamId, nodeId,
+            sinkMetricData.registerMetricsForDirtyBytes(inLongGroupId, inLongStreamId,
+                    nodeId, "dirtyBytes");
+            sinkMetricData.registerMetricsForDirtyRecords(inLongGroupId, inLongStreamId,
+                    nodeId, "dirtyRecords");
+            sinkMetricData.registerMetricsForNumBytesOut(inLongGroupId, inLongStreamId,
+                    nodeId, "numBytesOut");
+            sinkMetricData.registerMetricsForNumRecordsOut(inLongGroupId, inLongStreamId,
+                    nodeId, "numRecordsOut");
+            sinkMetricData.registerMetricsForNumBytesOutPerSecond(inLongGroupId, inLongStreamId, nodeId,
+                    "numBytesOutPerSecond");
+            sinkMetricData.registerMetricsForNumRecordsOutPerSecond(inLongGroupId, inLongStreamId, nodeId,

Review Comment:
   @gong DONE



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


[GitHub] [inlong] dockerzhang merged pull request #5449: [INLONG-5446][Sort] Add reporting metric from JDBC to audit SDK and refactor according to…

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5449:
URL: https://github.com/apache/inlong/pull/5449


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