Package org.apache.cassandra.schema
Class SchemaConstants
- java.lang.Object
-
- org.apache.cassandra.schema.SchemaConstants
-
public final class SchemaConstants extends java.lang.ObjectWhen adding new String keyspace names here, double check if it needs to be added to PartitionDenylist.canDenylistKeyspace
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAUTH_KEYSPACE_NAMEstatic java.lang.StringDISTRIBUTED_KEYSPACE_NAMEstatic java.util.UUIDemptyVersionstatic intFILENAME_LENGTHLongest acceptable file name.static java.util.List<java.lang.String>LEGACY_AUTH_TABLESstatic java.util.Set<java.lang.String>LOCAL_SYSTEM_KEYSPACE_NAMESstatic intNAME_LENGTHThe longest permissible KS or CF name.static java.util.regex.PatternPATTERN_NON_WORD_CHARstatic java.util.regex.PatternPATTERN_WORD_CHARSstatic java.util.Set<java.lang.String>REPLICATED_SYSTEM_KEYSPACE_NAMESstatic java.lang.StringSCHEMA_KEYSPACE_NAMEstatic java.lang.StringSYSTEM_KEYSPACE_NAMEstatic intTABLE_NAME_LENGTHLongest acceptable table name, so it can be used in a directory name constructed with a suffix of a table id and a separator.static intTABLE_UUID_AS_HEX_LENGTHLength of a table uuid as a hex string.static java.lang.StringTRACE_KEYSPACE_NAMEstatic java.lang.StringVIRTUAL_SCHEMAstatic java.util.Set<java.lang.String>VIRTUAL_SYSTEM_KEYSPACE_NAMESstatic java.lang.StringVIRTUAL_VIEWS
-
Constructor Summary
Constructors Constructor Description SchemaConstants()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Set<java.lang.String>getSystemKeyspaces()Returns the set of all system keyspacesstatic booleanisLocalSystemKeyspace(java.lang.String keyspaceName)static booleanisNonVirtualSystemKeyspace(java.lang.String keyspaceName)static booleanisReplicatedSystemKeyspace(java.lang.String keyspaceName)static booleanisSystemKeyspace(java.lang.String keyspaceName)Checks if the keyspace is a system keyspace (local replicated or virtual).static booleanisValidCharsName(java.lang.String name)Validates that a name is not empty and contains only alphanumeric characters or underscore, so it can be used in file or directory names.static booleanisVirtualSystemKeyspace(java.lang.String keyspaceName)Checks if the keyspace is a virtual system keyspace.
-
-
-
Field Detail
-
PATTERN_WORD_CHARS
public static final java.util.regex.Pattern PATTERN_WORD_CHARS
-
PATTERN_NON_WORD_CHAR
public static final java.util.regex.Pattern PATTERN_NON_WORD_CHAR
-
SYSTEM_KEYSPACE_NAME
public static final java.lang.String SYSTEM_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
SCHEMA_KEYSPACE_NAME
public static final java.lang.String SCHEMA_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
TRACE_KEYSPACE_NAME
public static final java.lang.String TRACE_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
AUTH_KEYSPACE_NAME
public static final java.lang.String AUTH_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
DISTRIBUTED_KEYSPACE_NAME
public static final java.lang.String DISTRIBUTED_KEYSPACE_NAME
- See Also:
- Constant Field Values
-
VIRTUAL_SCHEMA
public static final java.lang.String VIRTUAL_SCHEMA
- See Also:
- Constant Field Values
-
VIRTUAL_VIEWS
public static final java.lang.String VIRTUAL_VIEWS
- See Also:
- Constant Field Values
-
LOCAL_SYSTEM_KEYSPACE_NAMES
public static final java.util.Set<java.lang.String> LOCAL_SYSTEM_KEYSPACE_NAMES
-
VIRTUAL_SYSTEM_KEYSPACE_NAMES
public static final java.util.Set<java.lang.String> VIRTUAL_SYSTEM_KEYSPACE_NAMES
-
REPLICATED_SYSTEM_KEYSPACE_NAMES
public static final java.util.Set<java.lang.String> REPLICATED_SYSTEM_KEYSPACE_NAMES
-
NAME_LENGTH
public static final int NAME_LENGTH
The longest permissible KS or CF name. Before CASSANDRA-16956, we used to care about not having the entire path longer than 255 characters because of Windows support but this limit is by implementing CASSANDRA-16956 not in effect anymore.- See Also:
- Constant Field Values
-
FILENAME_LENGTH
public static final int FILENAME_LENGTH
Longest acceptable file name. Longer names lead to too long file name error.- See Also:
- Constant Field Values
-
TABLE_UUID_AS_HEX_LENGTH
public static final int TABLE_UUID_AS_HEX_LENGTH
Length of a table uuid as a hex string.- See Also:
- Constant Field Values
-
TABLE_NAME_LENGTH
public static final int TABLE_NAME_LENGTH
Longest acceptable table name, so it can be used in a directory name constructed with a suffix of a table id and a separator.
-
emptyVersion
public static final java.util.UUID emptyVersion
-
LEGACY_AUTH_TABLES
public static final java.util.List<java.lang.String> LEGACY_AUTH_TABLES
-
-
Method Detail
-
isValidCharsName
public static boolean isValidCharsName(java.lang.String name)
Validates that a name is not empty and contains only alphanumeric characters or underscore, so it can be used in file or directory names.- Parameters:
name- the name to check- Returns:
- whether the non-empty name contains only valid characters
-
isLocalSystemKeyspace
public static boolean isLocalSystemKeyspace(java.lang.String keyspaceName)
- Returns:
- whether or not the keyspace is a really system one (w/ LocalStrategy, unmodifiable, hardcoded)
-
isReplicatedSystemKeyspace
public static boolean isReplicatedSystemKeyspace(java.lang.String keyspaceName)
- Returns:
- whether or not the keyspace is a replicated system ks (system_auth, system_traces, system_distributed)
-
isVirtualSystemKeyspace
public static boolean isVirtualSystemKeyspace(java.lang.String keyspaceName)
Checks if the keyspace is a virtual system keyspace.- Returns:
trueif the keyspace is a virtual system keyspace,falseotherwise.
-
isSystemKeyspace
public static boolean isSystemKeyspace(java.lang.String keyspaceName)
Checks if the keyspace is a system keyspace (local replicated or virtual).- Returns:
trueif the keyspace is a system keyspace,falseotherwise.
-
isNonVirtualSystemKeyspace
public static boolean isNonVirtualSystemKeyspace(java.lang.String keyspaceName)
- Returns:
- whether or not the keyspace is a non-virtual, system keyspace
-
getSystemKeyspaces
public static java.util.Set<java.lang.String> getSystemKeyspaces()
Returns the set of all system keyspaces- Returns:
- all system keyspaces
-
-