rich7420 opened a new pull request, #11168:
URL: https://github.com/apache/ozone/pull/11168
## What changes were proposed in this pull request?
`DatanodeEntry` keeps the set of containers hosted on a datanode. Inside
SCM's
`NodeStateMap` there is one such entry per datanode, and every container
report
adds/removes/looks up `ContainerID`s in it. The set was a `TreeSet`, so every
insert paid `O(log n)` to keep the containers in sorted order, but nothing
reads
that order:
- `DatanodeEntry` only exposes the set through `Set<ContainerID>` (via
`copyContainers()`), never `NavigableSet`/`SortedSet`, so callers cannot
rely
on ordering.
- The consumers of `NodeManager.getContainers(dn)` iterate for membership,
counting, or set math; none depends on sorted iteration.
- The set is in-memory only and is not serialized to the wire.
This swaps both the field and the `copyContainers()` copy to `HashSet`,
giving
`O(1)` add/remove/contains on the per-datanode container index and dropping
the
ordering work that no one uses. The ordered `NavigableSet` in
`PipelineStateMap`
is a different set and is untouched.
## What is the link to the Apache Jira
https://issues.apache.org/jira/browse/HDDS-16349
## How was this patch tested?
Existing SCM node-state and container-report suites, run locally and green:
`TestContainerReportHandler`, `TestIncrementalContainerReportHandler`,
`TestNodeStateMap`, `TestSCMNodeManager`, `TestNodeDecommissionManager`,
`TestDatanodeAdminMonitor`, `TestDeadNodeHandler` (181 tests, 0 failures).
`checkstyle` and `pmd` clean. No behavior change, so no new test is added.
--
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]