Skip to content

Conversation

@symious
Copy link
Contributor

@symious symious commented Mar 16, 2023

What changes were proposed in this pull request?

This ticket is to add ContainerChoosingPolicy and VolumeChoosingPolicy for DiskBalancer Service.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-8182

How was this patch tested?

unit test.

@symious
Copy link
Contributor Author

symious commented Mar 16, 2023

@ChenSammi Could you help to review the PR?

@ChenSammi ChenSammi self-requested a review March 17, 2023 15:01
DefaultContainerChoosingPolicy.class,
ContainerChoosingPolicy.class).newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please log error meg here.


@Override
public ContainerData chooseContainer(OzoneContainer ozoneContainer,
HddsVolume hddsVolume, Set<Long> inProgressContainerIDs) {
Copy link
Contributor

@ChenSammi ChenSammi Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should turn this API into a batch API.
ozoneContainer.getController().getContainers(hddsVolume) will be a quite expensive operation once the container per volume reach a high number. Try to mostly leverage the result in one chooseContainer call, batch allocation or cache the container list of this volume for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a new parameter "targetSize" for batch retrieve of containers here.


// Can not generate DiskBalancerTask if we have less than 2 results
if (volumes.size() <= 1) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please log a debug level msg for this case.

return diskBalancerConfiguration;
}
} No newline at end of file
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this unnecessary change in this and the following two files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checkstyle will prompt the following warnings:

hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/node/DiskBalancerStatus.java
 1: File does not end with a newline.

@kerneltime kerneltime requested a review from sodonnel March 20, 2023 16:14
LoggerFactory.getLogger(DiskBalancerConfiguration.class);

public static final String HDDS_DATANODE_DISK_BALANCER_VOLUME_CHOOSING_POLICY
= "hdds.datanode.disk.balancer.volume.choosing.policy";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the @config annotation for these two properties.

@ChenSammi
Copy link
Contributor

LGTM, +1.

@ChenSammi ChenSammi merged commit 22f4fe7 into apache:HDDS-5713 Apr 10, 2023
sodonnel pushed a commit to sodonnel/hadoop-ozone that referenced this pull request Feb 1, 2024
sadanand48 pushed a commit to sadanand48/hadoop-ozone that referenced this pull request Apr 17, 2024
sadanand48 pushed a commit to sadanand48/hadoop-ozone that referenced this pull request Apr 17, 2024
ChenSammi pushed a commit to ChenSammi/ozone that referenced this pull request Feb 19, 2025
ChenSammi pushed a commit to ChenSammi/ozone that referenced this pull request Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants