greenwich commented on code in PR #10410:
URL: https://github.com/apache/ozone/pull/10410#discussion_r3360365495


##########
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/client/StorageTier.java:
##########
@@ -40,21 +37,23 @@ public enum StorageTier {
 
   private final String tierName;
   private final List<StorageType> storageTypes;
-  private final boolean uniformStorageType;
-  private static final Map<StorageTier, Map<ReplicationConfig, 
List<StorageType>>>
+  private final boolean isUniform;
+  private static final Map<StorageTier, Map<Integer, List<StorageType>>>
       CACHE = new EnumMap<>(StorageTier.class);
+  public static final int MAX_NODE_COUNT = 20;

Review Comment:
   20 is undocumented and effectively defines a silent max replication width - 
makes sense to document it.
   
   For uniform tiers, `computeStorageTypes `is just `Collections.nCopies(...)` 
(O(1)), so the cache isn't buying anything. Suggest dropping it - it will make 
everything clear. 
    
   ``` 
     public List<StorageType> getStorageTypes(int nodeCount) {
       return computeStorageTypes(nodeCount);
     }
   
   I am sure we don't need the cache for future 
`fromID/computeId/findSupportedStorageTiers` work.
   ```
   (or, if keeping the precompute, fall through to 
`computeStorageTypes(nodeCount)` on a miss and make `MAX_NODE_COUNT` private.)



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