szetszwo commented on code in PR #5335:
URL: https://github.com/apache/ozone/pull/5335#discussion_r1361458731
##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerStateManagerImpl.java:
##########
@@ -290,6 +290,16 @@ public Set<ContainerID> getContainerIDs(final
LifeCycleState state) {
}
}
+ @Override
+ public Set<ContainerID> getContainerIDs(final String owner) {
+ lock.readLock().lock();
+ try {
+ return containers.getContainerIDsByOwner(owner);
+ } finally {
+ lock.readLock().unlock();
+ }
Review Comment:
Use the `readLock()` method.
```java
try (AutoCloseableLock ignored = readLock()) {
return containers.getContainerIDsByOwner(owner);
}
```
--
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]