anuragp010 commented on code in PR #11399:
URL: https://github.com/apache/ozone/pull/11399#discussion_r4338858756
##########
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:
When can `volumeStorageType` be `null` while `storageType` is set? I see
that during container creation, importing or loading, the container always has
a volume. Since both of these fields would be part of the same release, is
there a scenario where a replica is reported with a `storageType` but without
`volumeStorageType`?
--
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]