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


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/ContainerReplica.java:
##########
@@ -150,6 +150,19 @@ public StorageType getVolumeStorageType() {
     return volumeStorageType;
   }
 
+  /**
+   * The storage type a copy of this replica should be placed on to stay on the
+   * same tier. Prefers the volume the replica actually lives on, since that is
+   * ground truth, and falls back to the type the container was created for.
+   *
+   * @return the storage type to target, or null when neither was reported, 
which
+   *         leaves the target free to choose any volume
+   */
+  @Nullable
+  public StorageType getTargetStorageTypeForCopy() {
+    return volumeStorageType != null ? volumeStorageType : storageType;

Review Comment:
   Yeah, usually this code is defensive and don't see the case when 
`volumeStorageType` be null while `storageType` is set,  code is just to 
specify a preference one over another.



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