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/23 01:58:10 UTC
[GitHub] [incubator-inlong] chantccc commented on a change in pull request #2267: [INLONG-2266][Feature]Support reporting metrics by audit-sdk in sort
chantccc commented on a change in pull request #2267:
URL: https://github.com/apache/incubator-inlong/pull/2267#discussion_r790204207
##########
File path: inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/deserialization/DeserializationSchema.java
##########
@@ -122,7 +145,23 @@ public void processElement(
context.output(METRIC_DATA_OUTPUT_TAG, metricData);
}
- collector.collect(recordTransformer.toSerializedRecord(sinkRecord));
+ SerializedRecord serializedSinkRecord = recordTransformer.toSerializedRecord(sinkRecord);
+
+ if (auditImp != null) {
+ Pair<String, String> groupIdAndStreamId = inLongGroupIdAndStreamIdMap.getOrDefault(
+ serializedRecord.getDataFlowId(),
+ Pair.of("", ""));
+
+ auditImp.add(
+ Constants.METRIC_AUDIT_ID_FOR_INPUT,
+ groupIdAndStreamId.getLeft(),
+ groupIdAndStreamId.getRight(),
+ sinkRecord.getTimestampMillis(),
Review comment:
sinkRecord.getTimestampMillis() is event time extracted from pulsar/tube message
##########
File path: inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/hive/HiveMultiTenantWriter.java
##########
@@ -126,6 +147,20 @@ public void processElement(SerializedRecord serializedRecord, Context context,
hiveWriter.processElement(recordTransformer.toRecord(serializedRecord).getRow(),
proxyContext.setContext(context), collector);
+
+ if (auditImp != null) {
+ Pair<String, String> groupIdAndStreamId = inLongGroupIdAndStreamIdMap.getOrDefault(
+ serializedRecord.getDataFlowId(),
+ Pair.of("", ""));
+
+ auditImp.add(
+ Constants.METRIC_AUDIT_ID_FOR_OUTPUT,
+ groupIdAndStreamId.getLeft(),
+ groupIdAndStreamId.getRight(),
+ serializedRecord.getTimestampMillis(),
Review comment:
sinkRecord.getTimestampMillis() is event time extracted from pulsar/tube message
--
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