Package org.apache.cassandra.schema
Class SchemaConstants
java.lang.Object
org.apache.cassandra.schema.SchemaConstants
When adding new String keyspace names here, double check if it needs to be added to PartitionDenylist.canDenylistKeyspace
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final UUIDstatic final intLongest acceptable file name.static final intThe longest permissible KS or CF name.static final Patternstatic final Patternstatic final Stringstatic final Stringstatic final intLongest acceptable table name, so it can be used in a directory name constructed with a suffix of a table id and a separator.static final intLength of a table uuid as a hex string.static final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the set of local and replicated system keyspace namesReturns the set of all local and replicated system table namesReturns the set of all system keyspacesstatic booleanisLocalSystemKeyspace(String keyspaceName) static booleanisNonVirtualSystemKeyspace(String keyspaceName) static booleanisReplicatedSystemKeyspace(String keyspaceName) static booleanisSystemKeyspace(String keyspaceName) Checks if the keyspace is a system keyspace (local replicated or virtual).static booleanisValidCharsName(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(String keyspaceName) Checks if the keyspace is a virtual system keyspace.
-
Field Details
-
PATTERN_WORD_CHARS
-
PATTERN_NON_WORD_CHAR
-
SYSTEM_KEYSPACE_NAME
- See Also:
-
SCHEMA_KEYSPACE_NAME
- See Also:
-
TRACE_KEYSPACE_NAME
- See Also:
-
AUTH_KEYSPACE_NAME
- See Also:
-
DISTRIBUTED_KEYSPACE_NAME
- See Also:
-
VIRTUAL_SCHEMA
- See Also:
-
VIRTUAL_VIEWS
- See Also:
-
DUMMY_KEYSPACE_OR_TABLE_NAME
- See Also:
-
LOCAL_SYSTEM_KEYSPACE_NAMES
-
VIRTUAL_SYSTEM_KEYSPACE_NAMES
-
REPLICATED_SYSTEM_KEYSPACE_NAMES
-
NAME_LENGTH
public static final int NAME_LENGTHThe 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:
-
FILENAME_LENGTH
public static final int FILENAME_LENGTHLongest acceptable file name. Longer names lead to too long file name error.- See Also:
-
TABLE_UUID_AS_HEX_LENGTH
public static final int TABLE_UUID_AS_HEX_LENGTHLength of a table uuid as a hex string.- See Also:
-
TABLE_NAME_LENGTH
public static final int TABLE_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. -
emptyVersion
-
LEGACY_AUTH_TABLES
-
-
Constructor Details
-
SchemaConstants
public SchemaConstants()
-
-
Method Details
-
isValidCharsName
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
- Returns:
- whether or not the keyspace is a really system one (w/ LocalStrategy, unmodifiable, hardcoded)
-
isReplicatedSystemKeyspace
- Returns:
- whether or not the keyspace is a replicated system ks (system_auth, system_traces, system_distributed)
-
isVirtualSystemKeyspace
Checks if the keyspace is a virtual system keyspace.- Returns:
trueif the keyspace is a virtual system keyspace,falseotherwise.
-
isSystemKeyspace
Checks if the keyspace is a system keyspace (local replicated or virtual).- Returns:
trueif the keyspace is a system keyspace,falseotherwise.
-
isNonVirtualSystemKeyspace
- Returns:
- whether or not the keyspace is a non-virtual, system keyspace
-
getSystemKeyspaces
Returns the set of all system keyspaces- Returns:
- all system keyspaces
-
getLocalAndReplicatedSystemKeyspaceNames
Returns the set of local and replicated system keyspace names- Returns:
- all local and replicated system keyspace names
-
getLocalAndReplicatedSystemTableNames
Returns the set of all local and replicated system table names- Returns:
- all local and replicated system table names
-