devmadhuu commented on code in PR #10810:
URL: https://github.com/apache/ozone/pull/10810#discussion_r3703375420


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerManagerImpl.java:
##########
@@ -395,20 +402,26 @@ public ContainerInfo getMatchingContainer(final long 
size, final String owner,
   }
 
   /**
-   * Returns the container ID's matching with specified owner.
-   * @param pipeline
-   * @param owner
+   * Returns the container ID's matching with specified owner and storage tier.
+   * Containers with a null storage tier are treated as matching any tier
+   * (upgrade-compat with older containers that predate the storageTier field).
+   * @param pipeline pipeline
+   * @param owner owner
+   * @param storageTier storageTier
    * @return NavigableSet<ContainerID>
    */
-  private NavigableSet<ContainerID> getContainersForOwner(
-      Pipeline pipeline, String owner) throws IOException {
+  private NavigableSet<ContainerID> getContainersForOwnerAndStorageTier(
+      Pipeline pipeline, String owner, StorageTier storageTier) throws 
IOException {
     NavigableSet<ContainerID> containerIDs =
         pipelineManager.getContainersInPipeline(pipeline.getId());
     Iterator<ContainerID> containerIDIterator = containerIDs.iterator();
     while (containerIDIterator.hasNext()) {
       ContainerID cid = containerIDIterator.next();
       try {
-        if (!getContainer(cid).getOwner().equals(owner)) {
+        ContainerInfo info = getContainer(cid);
+        if (!info.getOwner().equals(owner) ||
+            (info.getStorageTier() != null && storageTier != null &&
+                !info.getStorageTier().equals(storageTier))) {

Review Comment:
   @xichen01 @ivandika3 if we are good to merge this PR ?



-- 
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]

Reply via email to