Package com.linkedin.venice.utils
Class RegionUtils
java.lang.Object
com.linkedin.venice.utils.RegionUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomposeRegionList(Set<String> regions) A helper function to compose a region list withREGION_FILTER_LIST_SEPARATOR.static intgetLocalKafkaClusterId(it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> clusterIdToAlias, String localRegionName) Finds the Kafka cluster ID for the local region.static StringgetLocalRegionName(VeniceProperties props, boolean isParentRegion) static StringgetRegionSpecificMetricPrefix(String localRegionName, String regionName) static booleanisRegionPartOfRegionsFilterList(String region, String regionFilter) A helper function to check if a region is part of the regions filter list.static StringnormalizeRegionName(String regionName) Returns the input region name if non-null and non-empty, otherwiseUNKNOWN_REGION.parseRegionRolloutOrderList(String rolloutOrderList) A helper function to split a region list withREGION_FILTER_LIST_SEPARATORparseRegionsFilterList(String regionsFilterList) A helper function to split a region list withREGION_FILTER_LIST_SEPARATOR
-
Field Details
-
UNKNOWN_REGION
- See Also:
-
-
Constructor Details
-
RegionUtils
public RegionUtils()
-
-
Method Details
-
normalizeRegionName
Returns the input region name if non-null and non-empty, otherwiseUNKNOWN_REGION. -
getLocalRegionName
-
getRegionSpecificMetricPrefix
-
parseRegionsFilterList
A helper function to split a region list withREGION_FILTER_LIST_SEPARATOR -
parseRegionRolloutOrderList
A helper function to split a region list withREGION_FILTER_LIST_SEPARATOR -
isRegionPartOfRegionsFilterList
A helper function to check if a region is part of the regions filter list. -
composeRegionList
A helper function to compose a region list withREGION_FILTER_LIST_SEPARATOR. This is the reverse ofparseRegionsFilterList(String).- Parameters:
regions- , a set of regions- Returns:
- a string of regions separated by
REGION_FILTER_LIST_SEPARATOR
-
getLocalKafkaClusterId
public static int getLocalKafkaClusterId(it.unimi.dsi.fastutil.ints.Int2ObjectMap<String> clusterIdToAlias, String localRegionName) Finds the Kafka cluster ID for the local region. Each region has exactly one primary Kafka cluster whose alias matches the region name. Separate RT topic clusters for incremental pushes use a "{region}_sep" alias convention and are treated as distinct regions, so they won't match.- Returns:
- the local cluster ID, or -1 if not found
-