Jackie-Jiang commented on code in PR #9306:
URL: https://github.com/apache/pinot/pull/9306#discussion_r965243931


##########
pinot-common/src/main/java/org/apache/pinot/common/utils/config/TierConfigUtils.java:
##########
@@ -47,6 +51,27 @@ public static boolean shouldRelocateToTiers(TableConfig 
tableConfig) {
     return CollectionUtils.isNotEmpty(tableConfig.getTierConfigsList());
   }
 
+  public static String getDataDirFromTierConfig(String tableNameWithType, 
String tierName, TableConfig tableConfig) {

Review Comment:
   (minor) We don't need to pass in table name because that can be read from 
the table config. Also suggest renaming the method:
   ```suggestion
     public static String getDataDirForTier(TableConfig tableConfig, String 
tierName) {
   ```



##########
pinot-common/src/main/java/org/apache/pinot/common/utils/config/TierConfigUtils.java:
##########
@@ -47,6 +51,27 @@ public static boolean shouldRelocateToTiers(TableConfig 
tableConfig) {
     return CollectionUtils.isNotEmpty(tableConfig.getTierConfigsList());
   }
 
+  public static String getDataDirFromTierConfig(String tableNameWithType, 
String tierName, TableConfig tableConfig) {
+    List<TierConfig> tierCfgs = tableConfig.getTierConfigsList();
+    Preconditions.checkState(CollectionUtils.isNotEmpty(tierCfgs), "No 
tierConfigs for table: %s", tableNameWithType);
+    TierConfig tierCfg = null;
+    for (TierConfig tc : tierCfgs) {
+      if (tierName.equalsIgnoreCase(tc.getName())) {

Review Comment:
   (minor) Should we do exact match?



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