szetszwo commented on code in PR #6500:
URL: https://github.com/apache/ozone/pull/6500#discussion_r1590356591
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerMetadataInspector.java:
##########
@@ -373,33 +375,32 @@ private boolean checkAndRepair(JsonObject parent,
return repaired;
};
- JsonObject blockCountError = buildErrorAndRepair("dBMetadata." +
+ ObjectNode blockCountError = buildErrorAndRepair("dBMetadata." +
OzoneConsts.BLOCK_COUNT, blockCountAggregate, blockCountDB,
keyRepairAction);
errors.add(blockCountError);
}
// Check and repair used bytes.
- JsonElement usedBytesDB = parent.getAsJsonObject("dBMetadata")
- .get(OzoneConsts.CONTAINER_BYTES_USED);
- JsonElement usedBytesAggregate = parent.getAsJsonObject("aggregates")
- .get("usedBytes");
+ JsonNode usedBytesDB = parent.path("dBMetadata")
+ .path(OzoneConsts.CONTAINER_BYTES_USED);
+ JsonNode usedBytesAggregate = parent.path("aggregates").path("usedBytes");
// If used bytes is absent from the DB, it is only an error if there is
// a non-zero aggregate of used bytes among the block keys.
long usedBytesDBLong = 0;
- if (!usedBytesDB.isJsonNull()) {
- usedBytesDBLong = usedBytesDB.getAsLong();
+ if (!usedBytesDB.isMissingNode()) {
Review Comment:
Sure, will wait for your change.
--
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]