smiklosovic commented on code in PR #4038:
URL: https://github.com/apache/cassandra/pull/4038#discussion_r2061257282
##########
src/java/org/apache/cassandra/schema/TableMetadata.java:
##########
@@ -602,11 +606,16 @@ public boolean dependsOn(Function function)
public void validate()
{
- if (!isNameValid(keyspace))
- except("Keyspace name must not be empty, more than %s characters
long, or contain non-alphanumeric-underscore characters (got \"%s\")",
SchemaConstants.NAME_LENGTH, keyspace);
+ if (!isValidKeyspaceName(keyspace))
+ except("Keyspace name must not be empty, more than %s characters
long, or contain non-alphanumeric-underscore characters (got \"%s\")",
NAME_LENGTH, keyspace);
Review Comment:
The "shortcoming" of the current approach is that you can not, easily,
reuse / check if something is valid or not. It is "burried" in
TableMetadata#validate(). If you extracted it to a helper class, it is there
for everybody to use easily.
SchemaConstants do not contain just _contstants_. It already contains
validation methods etc so I feel this would be a nice fit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]