vinothchandar commented on a change in pull request #3656:
URL: https://github.com/apache/hudi/pull/3656#discussion_r708249977
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/transaction/ControlEvent.java
##########
@@ -108,7 +109,9 @@ public int getVersion() {
@Override
public String toString() {
return String.format("%s %s %s %s %s %s", version, msgType.name(),
commitTime,
- Arrays.toString(senderPartition), coordinatorInfo.toString(),
participantInfo.toString());
+ Arrays.toString(senderPartition),
+ (coordinatorInfo == null) ? "" : coordinatorInfo.toString(),
Review comment:
if you simply do `cordinatorInfo` instead of
`coordinatorInfo.toString()` you can avoid the NPE
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/transaction/ControlEvent.java
##########
@@ -163,6 +166,13 @@ public CoordinatorInfo(Map<Integer, Long>
globalKafkaCommitOffsets) {
public Map<Integer, Long> getGlobalKafkaCommitOffsets() {
return (globalKafkaCommitOffsets == null) ? new HashMap<>() :
globalKafkaCommitOffsets;
}
+
+ @Override
+ public String toString() {
+ return String.format("%s", globalKafkaCommitOffsets.keySet().stream()
Review comment:
does nt this already return a string? why format it? for `null` handling?
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/transaction/TransactionParticipant.java
##########
@@ -35,7 +37,7 @@
void buffer(SinkRecord record);
- void processRecords();
+ void processRecords() throws IOException;
Review comment:
e.g `HoodieIOException`
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/writers/BufferedConnectWriter.java
##########
@@ -94,7 +94,7 @@ public void writeHudiRecord(HoodieRecord<HoodieAvroPayload>
record) {
}
@Override
- public List<WriteStatus> flushHudiRecords() {
+ public List<WriteStatus> flushHudiRecords() throws IOException {
Review comment:
rename: just flushRecords
##########
File path:
hudi-kafka-connect/src/main/java/org/apache/hudi/connect/transaction/TransactionParticipant.java
##########
@@ -35,7 +37,7 @@
void buffer(SinkRecord record);
- void processRecords();
+ void processRecords() throws IOException;
Review comment:
its better if all interfaces throw a unchecked hudi exception,
--
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]