ivandika3 commented on code in PR #8418:
URL: https://github.com/apache/ozone/pull/8418#discussion_r2080868374
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java:
##########
@@ -258,7 +258,7 @@ public int hashCode() {
}
public SnapshotDiffJobProto toProtoBuf() {
- return SnapshotDiffJobProto.newBuilder()
+ SnapshotDiffJobProto.Builder builder = SnapshotDiffJobProto.newBuilder()
.setCreationTime(creationTime)
.setJobId(jobId)
.setStatus(status.toProtobuf())
Review Comment:
Should we also check for `status` as well?
##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/helpers/SnapshotDiffJob.java:
##########
@@ -269,9 +269,11 @@ public SnapshotDiffJobProto toProtoBuf() {
.setForceFullDiff(forceFullDiff)
.setDisableNativeDiff(disableNativeDiff)
.setTotalDiffEntries(totalDiffEntries)
- .setSubStatus(subStatus.toProtoBuf())
- .setKeysProcessedPct(keysProcessedPct)
- .build();
+ .setKeysProcessedPct(keysProcessedPct);
+ if (subStatus != null) {
+ builder.setSubStatus(subStatus.toProtoBuf());
+ }
Review Comment:
If `subStatus` can be null, maybe we also need use
`diffJobProto.hasSubStatus` before in `SnapshotDiffJob#getFromProtoBuf`.
--
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]