gong commented on code in PR #6870:
URL: https://github.com/apache/inlong/pull/6870#discussion_r1047944224


##########
inlong-sort/sort-connectors/elasticsearch-base/src/main/java/org/apache/inlong/sort/elasticsearch/table/RowElasticsearchSinkFunction.java:
##########
@@ -146,55 +154,79 @@ public void snapshotState(FunctionSnapshotContext 
context) throws Exception {
 
     @Override
     public void process(RowData element, RuntimeContext ctx, RequestIndexer 
indexer) {
+        final String key;
+        try {
+            key = createKey.apply(element);
+        } catch (Exception e) {
+            LOGGER.error(String.format("Generate index id error, raw data: 
%s", element), e);
+            dirtySinkHelper.invoke(element, DirtyType.INDEX_ID_GENERATE_ERROR, 
e);
+            return;
+        }
+        final byte[] document;
+        try {
+            document = serializationSchema.serialize(element);
+        } catch (Exception e) {
+            LOGGER.error(String.format("Serialize error, raw data: %s", 
element), e);
+            dirtySinkHelper.invoke(element, DirtyType.SERIALIZE_ERROR, e);
+            return;

Review Comment:
   Here need compute dirty metric when upload dirty data



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