sylph-eu commented on code in PR #10746:
URL: https://github.com/apache/pinot/pull/10746#discussion_r1188856103
##########
pinot-common/src/main/java/org/apache/pinot/common/utils/config/TierConfigUtils.java:
##########
@@ -63,6 +68,33 @@ public static String getDataDirForTier(TableConfig
tableConfig, String tierName)
return getDataDirForTier(tableConfig, tierName, Collections.emptyMap());
}
+ /**
+ * Compute default instance partitions for every configured tier
+ *
+ * @return a map with tier names as keys, and default instance partitions as
values
+ */
+ public static Map<String, InstancePartitions>
getTierToInstancePartitionsMap(String tableNameWithType,
+ @Nullable List<Tier> sortedTiers, HelixManager helixManager) {
+ if (sortedTiers == null) {
+ return null;
+ }
+
+ Map<String, InstancePartitions> tierToInstancePartitionsMap = new
HashMap<>();
+ for (Tier tier : sortedTiers) {
+ LOGGER.info("Fetching/computing instance partitions for tier: {} of
table: {}", tier.getName(),
+ tableNameWithType);
+
+ final PinotServerTierStorage storage = (PinotServerTierStorage)
tier.getStorage();
Review Comment:
Fixed.
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/SegmentAssignmentUtils.java:
##########
@@ -408,6 +409,25 @@ public Map<String, Map<String, String>>
getNonTierSegmentAssignment() {
}
}
+ /**
+ * Checks tiers one-by-one to return the first one for which a newly
registered segment qualifies
+ * @param tableNameWithType table to which the segment assignment belongs
+ * @param sortedTiers list of tiers, pre-sorted as per desired order by
caller
+ * @param segmentName name of the new segment
+ * @return tier for which the segment qualifies, or null if segment doesn't
belong to any tier
+ */
+ public static Tier findTierForNewSegment(String tableNameWithType, @Nullable
List<Tier> sortedTiers,
Review Comment:
Fixed.
--
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]