Class TagNameUtils


  • public class TagNameUtils
    extends Object
    The TagNameUtils class handles the conversion between tenant and tag. For single-tenant cluster, use DEFAULT_TENANT_NAME ("DefaultTenant") as the tenant name.

    Example:

    • Tenant name: myTenant
    • Broker tag name: myTenant_BROKER
    • Offline server tag name: myTenant_OFFLINE
    • Realtime server tag name: myTenant_REALTIME
    Tag name can be overridden by TagOverrideConfig from TenantConfig.
    • Method Detail

      • isBrokerTag

        public static boolean isBrokerTag​(String tagName)
        Returns whether the given tag is a broker tag.
      • isServerTag

        public static boolean isServerTag​(String tagName)
        Returns whether the given tag is a server tag (OFFLINE or REALTIME).
      • isOfflineServerTag

        public static boolean isOfflineServerTag​(String tagName)
        Returns whether the given tag is an OFFLINE server tag.
      • isRealtimeServerTag

        public static boolean isRealtimeServerTag​(String tagName)
        Returns whether the given tag is an REALTIME server tag.
      • getTenantFromTag

        public static String getTenantFromTag​(String tagName)
        Returns the tenant name for the given tag. The given tag should be valid (with proper tag suffix).
      • getBrokerTagForTenant

        public static String getBrokerTagForTenant​(@Nullable
                                                   String tenantName)
        Returns the Broker tag name for the given tenant.
      • getOfflineTagForTenant

        public static String getOfflineTagForTenant​(@Nullable
                                                    String tenantName)
        Returns the OFFLINE server tag name for the given tenant.
      • getRealtimeTagForTenant

        public static String getRealtimeTagForTenant​(@Nullable
                                                     String tenantName)
        Returns the REALTIME server tag name for the given tenant.
      • extractBrokerTag

        public static String extractBrokerTag​(TenantConfig tenantConfig)
        Extracts the broker tag name from the given tenant config.
      • extractOfflineServerTag

        public static String extractOfflineServerTag​(TenantConfig tenantConfig)
        Extracts the OFFLINE server tag name from the given tenant config.
      • extractRealtimeServerTag

        public static String extractRealtimeServerTag​(TenantConfig tenantConfig)
        Extracts the REALTIME server tag name from the given tenant config.
      • extractConsumingServerTag

        public static String extractConsumingServerTag​(TenantConfig tenantConfig)
        Extracts the REALTIME consuming server tag name from the given tenant config.
      • extractCompletedServerTag

        public static String extractCompletedServerTag​(TenantConfig tenantConfig)
        Extracts the REALTIME completed server tag name from the given tenant config.
      • isRelocateCompletedSegments

        public static boolean isRelocateCompletedSegments​(TenantConfig tenantConfig)
        Returns whether the completed segments need to be relocated (completed server tag is different from consuming server tag).