smengcl commented on code in PR #8450:
URL: https://github.com/apache/ozone/pull/8450#discussion_r2103191766
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/KeyDeletingService.java:
##########
@@ -186,9 +173,116 @@ public void setKeyLimitPerTask(int keyLimitPerTask) {
*/
private final class KeyDeletingTask implements BackgroundTask {
private final KeyDeletingService deletingService;
+ private final UUID snapshotId;
- private KeyDeletingTask(KeyDeletingService service) {
+ private KeyDeletingTask(KeyDeletingService service, UUID snapshotId) {
this.deletingService = service;
+ this.snapshotId = snapshotId;
+ }
+
+ private OzoneManagerProtocolProtos.SetSnapshotPropertyRequest
getSetSnapshotRequestUpdatingExclusiveSize(
+ Map<UUID, Long> exclusiveSizeMap, Map<UUID, Long>
exclusiveReplicatedSizeMap, UUID snapshotID) {
+ OzoneManagerProtocolProtos.SnapshotSize snapshotSize =
OzoneManagerProtocolProtos.SnapshotSize.newBuilder()
+ .setExclusiveSize(
+ exclusiveSizeMap.getOrDefault(snapshotID, 0L))
+ .setExclusiveReplicatedSize(
+ exclusiveReplicatedSizeMap.getOrDefault(
+ snapshotID, 0L))
+ .build();
+ exclusiveSizeMap.remove(snapshotID);
+ exclusiveReplicatedSizeMap.remove(snapshotID);
Review Comment:
This is frowned upon. Looks like bad isolation.
Can we at least put a javadoc on this helper method saying this method
drains both maps?
--
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]