Class TagNameUtils
- java.lang.Object
-
- org.apache.pinot.common.utils.config.TagNameUtils
-
public class TagNameUtils extends Object
TheTagNameUtilsclass handles the conversion between tenant and tag. For single-tenant cluster, useDEFAULT_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
TagOverrideConfigfromTenantConfig.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TENANT_NAME
-
Method Summary
Modifier and Type Method Description static StringextractBrokerTag(TenantConfig tenantConfig)Extracts the broker tag name from the given tenant config.static StringextractCompletedServerTag(TenantConfig tenantConfig)Extracts the REALTIME completed server tag name from the given tenant config.static StringextractConsumingServerTag(TenantConfig tenantConfig)Extracts the REALTIME consuming server tag name from the given tenant config.static StringextractOfflineServerTag(TenantConfig tenantConfig)Extracts the OFFLINE server tag name from the given tenant config.static StringextractRealtimeServerTag(TenantConfig tenantConfig)Extracts the REALTIME server tag name from the given tenant config.static StringgetBrokerTagForTenant(String tenantName)Returns the Broker tag name for the given tenant.static StringgetOfflineTagForTenant(String tenantName)Returns the OFFLINE server tag name for the given tenant.static StringgetRealtimeTagForTenant(String tenantName)Returns the REALTIME server tag name for the given tenant.static StringgetTenantFromTag(String tagName)Returns the tenant name for the given tag.static booleanisBrokerTag(String tagName)Returns whether the given tag is a broker tag.static booleanisOfflineServerTag(String tagName)Returns whether the given tag is an OFFLINE server tag.static booleanisRealtimeServerTag(String tagName)Returns whether the given tag is an REALTIME server tag.static booleanisRelocateCompletedSegments(TenantConfig tenantConfig)Returns whether the completed segments need to be relocated (completed server tag is different from consuming server tag).static booleanisServerTag(String tagName)Returns whether the given tag is a server tag (OFFLINE or REALTIME).
-
-
-
Field Detail
-
DEFAULT_TENANT_NAME
public static final String DEFAULT_TENANT_NAME
- See Also:
- Constant Field Values
-
-
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).
-
-