Class RegionUtils

java.lang.Object
com.linkedin.venice.utils.RegionUtils

public class RegionUtils extends Object
  • Field Details

  • Constructor Details

    • RegionUtils

      public RegionUtils()
  • Method Details

    • normalizeRegionName

      public static String normalizeRegionName(String regionName)
      Returns the input region name if non-null and non-empty, otherwise UNKNOWN_REGION.
    • getLocalRegionName

      public static String getLocalRegionName(VeniceProperties props, boolean isParentRegion)
    • getRegionSpecificMetricPrefix

      public static String getRegionSpecificMetricPrefix(String localRegionName, String regionName)
    • parseRegionsFilterList

      public static Set<String> parseRegionsFilterList(String regionsFilterList)
      A helper function to split a region list with REGION_FILTER_LIST_SEPARATOR
    • parseRegionRolloutOrderList

      public static List<String> parseRegionRolloutOrderList(String rolloutOrderList)
      A helper function to split a region list with REGION_FILTER_LIST_SEPARATOR
    • isRegionPartOfRegionsFilterList

      public static boolean isRegionPartOfRegionsFilterList(String region, String regionFilter)
      A helper function to check if a region is part of the regions filter list.
    • composeRegionList

      public static String composeRegionList(Set<String> regions)
      A helper function to compose a region list with REGION_FILTER_LIST_SEPARATOR. This is the reverse of parseRegionsFilterList(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