This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git
The following commit(s) were added to refs/heads/master by this push:
new a94f0fa8ff [INLONG-9739][Sort] onParsingBodyFailure function in
FailureHandler class need add 'head' paramete to generate failure metric (#9740)
a94f0fa8ff is described below
commit a94f0fa8ff61462ba999f6f89cbfd2b8fab28af7
Author: baomingyu <[email protected]>
AuthorDate: Wed Feb 28 20:15:21 2024 +0800
[INLONG-9739][Sort] onParsingBodyFailure function in FailureHandler class
need add 'head' paramete to generate failure metric (#9740)
---
.../java/org/apache/inlong/sort/formats/inlongmsg/FailureHandler.java | 2 +-
.../apache/inlong/sort/formats/inlongmsg/IgnoreFailureHandler.java | 4 ++--
.../org/apache/inlong/sort/formats/inlongmsg/NoOpFailureHandler.java | 4 ++--
.../sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java | 2 +-
.../sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java | 2 +-
.../sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java | 2 +-
.../inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java | 2 +-
.../inlongmsgtlogkv/InLongMsgTlogKvFormatDeserializerTest.java | 2 +-
.../sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java | 2 +-
.../sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java | 2 +-
.../sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java | 2 +-
.../inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java | 2 +-
12 files changed, 14 insertions(+), 14 deletions(-)
diff --git
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/FailureHandler.java
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/FailureHandler.java
index 00b0249d51..7dff44fa10 100644
---
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/FailureHandler.java
+++
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/FailureHandler.java
@@ -40,7 +40,7 @@ public interface FailureHandler extends Serializable {
* @param exception the thrown exception
* @throws Exception the exception
*/
- void onParsingBodyFailure(byte[] body, Exception exception) throws
Exception;
+ void onParsingBodyFailure(InLongMsgHead head, byte[] body, Exception
exception) throws Exception;
/**
* This method is called when there is a failure occurred while converting
head and body to row.
diff --git
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/IgnoreFailureHandler.java
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/IgnoreFailureHandler.java
index bb57bddfba..6ac0b956f2 100644
---
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/IgnoreFailureHandler.java
+++
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/IgnoreFailureHandler.java
@@ -33,8 +33,8 @@ public class IgnoreFailureHandler implements FailureHandler {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception) {
- LOG.warn("Cannot properly parse the body: {}.", new String(body),
exception);
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) {
+ LOG.warn("Cannot properly parse the head: {}, body: {}.", head, new
String(body), exception);
}
@Override
diff --git
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/NoOpFailureHandler.java
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/NoOpFailureHandler.java
index 3f4eb090fa..66eeb19e69 100644
---
a/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/NoOpFailureHandler.java
+++
b/inlong-sort/sort-formats/format-common/src/main/java/org/apache/inlong/sort/formats/inlongmsg/NoOpFailureHandler.java
@@ -34,8 +34,8 @@ public class NoOpFailureHandler implements FailureHandler {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception) throws
Exception {
- LOG.error("Cannot properly parse the body: {}.", new String(body),
exception);
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
+ LOG.error("Cannot properly parse the head: {}, the body: {}.", head,
new String(body), exception);
throw exception;
}
diff --git
a/inlong-sort/sort-formats/format-row/format-inlongmsg-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
b/inlong-sort/sort-formats/format-row/format-inlongmsg-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
index 4ec6a5e08d..79378468a5 100644
---
a/inlong-sort/sort-formats/format-row/format-inlongmsg-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
+++
b/inlong-sort/sort-formats/format-row/format-inlongmsg-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
@@ -103,7 +103,7 @@ public abstract class AbstractInLongMsgFormatDeserializer
extends TableFormatDes
try {
bodyList = parseBodyList(bodyBytes);
} catch (Exception e) {
- failureHandler.onParsingBodyFailure(bodyBytes, e);
+ failureHandler.onParsingBodyFailure(head, bodyBytes, e);
continue;
}
diff --git
a/inlong-sort/sort-formats/format-row/format-inlongmsg-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-row/format-inlongmsg-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
index f2fd5436ad..7a65ee7e8a 100644
---
a/inlong-sort/sort-formats/format-row/format-inlongmsg-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-row/format-inlongmsg-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
@@ -725,7 +725,7 @@ public class InLongMsgCsvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-row/format-inlongmsg-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-row/format-inlongmsg-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
index 911486ed6a..c29258ee42 100644
---
a/inlong-sort/sort-formats/format-row/format-inlongmsg-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-row/format-inlongmsg-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
@@ -319,7 +319,7 @@ public class InLongMsgKvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
index 4060fda847..545ea9d2ae 100644
---
a/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
@@ -272,7 +272,7 @@ public class InLongMsgTlogCsvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogkv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogkv/InLongMsgTlogKvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogkv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogkv/InLongMsgTlogKvFormatDeserializerTest.java
index e722ae226a..4ac7d3edb2 100644
---
a/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogkv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogkv/InLongMsgTlogKvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-row/format-inlongmsg-tlogkv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogkv/InLongMsgTlogKvFormatDeserializerTest.java
@@ -200,7 +200,7 @@ public class InLongMsgTlogKvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
index 0391fde59a..9f63185102 100644
---
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
+++
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-base/src/main/java/org/apache/inlong/sort/formats/inlongmsg/AbstractInLongMsgFormatDeserializer.java
@@ -111,7 +111,7 @@ public abstract class AbstractInLongMsgFormatDeserializer
implements ResultTypeQ
bodyList = parseBodyList(bodyBytes);
} catch (Exception e) {
reportDeSerializeErrorMetrics();
- failureHandler.onParsingBodyFailure(bodyBytes, e);
+ failureHandler.onParsingBodyFailure(head, bodyBytes, e);
continue;
}
diff --git
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
index 47e3fe0595..9857c6ece0 100644
---
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-csv/src/test/java/org/apache/inlong/sort/formats/inlongmsgcsv/InLongMsgCsvFormatDeserializerTest.java
@@ -848,7 +848,7 @@ public class InLongMsgCsvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
index 3332bd21f0..39f3fd83d7 100644
---
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-kv/src/test/java/org/apache/inlong/sort/formats/inlongmsgkv/InLongMsgKvFormatDeserializerTest.java
@@ -332,7 +332,7 @@ public class InLongMsgKvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}
diff --git
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
index 5929dadebe..65423431be 100644
---
a/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
+++
b/inlong-sort/sort-formats/format-rowdata/format-inlongmsg-rowdata-tlogcsv/src/test/java/org/apache/inlong/sort/formats/inlongmsgtlogcsv/InLongMsgTlogCsvFormatDeserializerTest.java
@@ -324,7 +324,7 @@ public class InLongMsgTlogCsvFormatDeserializerTest {
}
@Override
- public void onParsingBodyFailure(byte[] body, Exception exception)
throws Exception {
+ public void onParsingBodyFailure(InLongMsgHead head, byte[] body,
Exception exception) throws Exception {
bodyCount++;
}