aryangupta1998 commented on a change in pull request #1885:
URL: https://github.com/apache/ozone/pull/1885#discussion_r592787533
##########
File path:
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/statemachine/background/BlockDeletingService.java
##########
@@ -113,36 +106,53 @@ public BlockDeletingService(OzoneContainer ozoneContainer,
throw new RuntimeException(e);
}
this.conf = conf;
- this.blockLimitPerTask =
- conf.getInt(OZONE_BLOCK_DELETING_LIMIT_PER_CONTAINER,
+ this.blockLimitPerInterval =
+ conf.getInt(OZONE_BLOCK_DELETING_LIMIT_PER_INTERVAL,
OZONE_BLOCK_DELETING_LIMIT_PER_CONTAINER_DEFAULT);
- this.containerLimitPerInterval =
- conf.getInt(OZONE_BLOCK_DELETING_CONTAINER_LIMIT_PER_INTERVAL,
- OZONE_BLOCK_DELETING_CONTAINER_LIMIT_PER_INTERVAL_DEFAULT);
+ }
+
+ public static class ContainerBlockInfo {
+ private final ContainerData containerData;
+ private final Long blocks;
+
+ public ContainerBlockInfo(ContainerData containerData, Long blocks) {
+ this.containerData = containerData;
+ this.blocks = blocks;
+ }
+
+ public ContainerData getContainerData() {
+ return containerData;
+ }
+
+ public Long getBlocks() {
+ return blocks;
+ }
+
}
@Override
public BackgroundTaskQueue getTasks() {
BackgroundTaskQueue queue = new BackgroundTaskQueue();
- List<ContainerData> containers = Lists.newArrayList();
+ List<ContainerBlockInfo> containers = Lists.newArrayList();
try {
// We at most list a number of containers a time,
// in case there are too many containers and start too many workers.
// We must ensure there is no empty container in this result.
// The chosen result depends on what container deletion policy is
// configured.
- containers = chooseContainerForBlockDeletion(containerLimitPerInterval,
+ containers = chooseContainerForBlockDeletion(blockLimitPerInterval,
containerDeletionPolicy);
if (containers.size() > 0) {
- LOG.info("Plan to choose {} containers for block deletion, "
+ LOG.info("Plan to choose {} blocks for block deletion, "
+ "actually returns {} valid containers.",
- containerLimitPerInterval, containers.size());
+ blockLimitPerInterval, containers.size());
}
Review comment:
Moved after BlockDeletingTask creation.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]