Copilot commented on code in PR #59883:
URL: https://github.com/apache/doris/pull/59883#discussion_r2690042985
##########
fe/fe-core/src/main/java/org/apache/doris/job/offset/jdbc/JdbcSourceOffsetProvider.java:
##########
@@ -353,10 +353,20 @@ public void replayIfNeed(StreamingInsertJob job) throws
JobException {
currentOffset.setSplit(lastSnapshotSplit);
}
}
- } catch (Exception ex) {
- log.warn("Replay snapshot splits error with job {} ",
job.getJobId(), ex);
- throw new JobException(ex);
}
+ } else if (checkNeedSplitChunks(sourceProperties)
+ && CollectionUtils.isEmpty(remainingSplits)
+ && CollectionUtils.isEmpty(finishedSplits)
+ && MapUtils.isEmpty(chunkHighWatermarkMap)
+ && MapUtils.isEmpty(binlogOffsetPersist)) {
Review Comment:
This compound conditional with five conditions is difficult to read and
maintain. Consider extracting this logic into a well-named private method like
'isInitialStateAfterRestart()' to improve code clarity and make the intent more
explicit.
##########
fe/fe-core/src/main/java/org/apache/doris/job/util/StreamingJobUtils.java:
##########
@@ -130,12 +130,17 @@ public static Map<String, List<SnapshotSplit>>
restoreSplitsToJob(Long jobId) th
}
Map<String, List<SnapshotSplit>> tableSplits = new LinkedHashMap<>();
- for (ResultRow row : resultRows) {
- String tableName = row.get(0);
- String chunkListStr = row.get(1);
- List<SnapshotSplit> splits =
- new
ArrayList<>(Arrays.asList(objectMapper.readValue(chunkListStr,
SnapshotSplit[].class)));
- tableSplits.put(tableName, splits);
+ try {
+ for (ResultRow row : resultRows) {
+ String tableName = row.get(0);
+ String chunkListStr = row.get(1);
+ List<SnapshotSplit> splits =
+ new
ArrayList<>(Arrays.asList(objectMapper.readValue(chunkListStr,
SnapshotSplit[].class)));
+ tableSplits.put(tableName, splits);
+ }
+ } catch (IOException ex) {
+ log.warn("Failed to deserialize snapshot splits from job {} meta
table: {}", jobId, ex.getMessage());
Review Comment:
The error message only includes ex.getMessage() which may be null for some
IOExceptions. Consider logging the full exception or using a more descriptive
message that includes the actual cause of the deserialization failure.
```suggestion
log.warn("Failed to deserialize snapshot splits from job {} meta
table", jobId, ex);
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]