Gargi-jais11 commented on code in PR #10022:
URL: https://github.com/apache/ozone/pull/10022#discussion_r3116802588
##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/diskbalancer/DiskBalancerConfiguration.java:
##########
@@ -262,17 +287,80 @@ public void setParallelThread(int parallelThread) {
this.parallelThread = parallelThread;
}
+ public String getContainerStates() {
+ return containerStates;
+ }
+
+ public void setContainerStates(String containerStates) {
+ this.containerStates = containerStates;
+ }
+
+ /**
+ * Container lifecycle states eligible for disk balancing, parsed from
{@link #getContainerStates()}:
+ * a comma-separated list of {@link State} names (case-sensitive, uppercase;
whitespace trimmed).
+ *
+ * @return unmodifiable non-empty set
+ */
+ public Set<State> getMovableContainerStates() {
Review Comment:
Done verifying the new setting value in `setContainerStates`.
In order to make `getMovableContainerStates` private and only use it from
`setContainerStates`. That only works if every time the config is loaded,
`setContainerStates` runs.
It doesn’t: for
`OzoneConfiguration.getObject(DiskBalancerConfiguration.class)`, the framework
binds `hdds.datanode.disk.balancer.container.states` by writing the
containerStates field directly and **setContainerStates** is not invoked.
So code like `DefaultContainerChoosingPolicy, DiskBalancerService, tests`,
etc. still need a public way to get **Set<State>** from that object. Today
that’s **getMovableContainerStates()**, which parses the injected string on
read.
If we made that method private and only called it from `setContainerStates`,
those getObject(...) instances would never get a parsed set.
--
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]