tolbertam commented on code in PR #4558:
URL: https://github.com/apache/cassandra/pull/4558#discussion_r2836614628
##########
src/java/org/apache/cassandra/schema/SystemDistributedKeyspace.java:
##########
@@ -99,7 +99,20 @@ private SystemDistributedKeyspace()
public static final String AUTO_REPAIR_PRIORITY = "auto_repair_priority";
- public static final Set<String> TABLE_NAMES =
ImmutableSet.of(REPAIR_HISTORY, PARENT_REPAIR_HISTORY, VIEW_BUILD_STATUS,
PARTITION_DENYLIST_TABLE, AUTO_REPAIR_HISTORY, AUTO_REPAIR_PRIORITY);
+ /**
+ * Returns the set of table names for the system_distributed keyspace.
+ * When AUTOREPAIR_ENABLE is false, auto-repair tables are not included.
+ */
+ public static Set<String> getTableNames()
+ {
+ if (CassandraRelevantProperties.AUTOREPAIR_ENABLE.getBoolean())
+ {
+ return ImmutableSet.of(REPAIR_HISTORY, PARENT_REPAIR_HISTORY,
VIEW_BUILD_STATUS,
+ PARTITION_DENYLIST_TABLE,
AUTO_REPAIR_HISTORY, AUTO_REPAIR_PRIORITY);
+ }
+ return ImmutableSet.of(REPAIR_HISTORY, PARENT_REPAIR_HISTORY,
VIEW_BUILD_STATUS,
+ PARTITION_DENYLIST_TABLE);
Review Comment:
minor nit: As far as I can tell this method is currently only used via
`Convertes.TABLE_COUNT_THRESHOLD_TO_GUARDRAIL` via `
SchemaConstants.getLocalAndReplicatedSystemTableNames()`, but to avoid possible
frequent recreation of the Set couldn't we do something like:
```java
/**
* table names for the system_distributed keyspace.
* When AUTOREPAIR_ENABLE is false, auto-repair tables are not included.
*/
public static final Set<String> TABLE_NAMES;
static {
if (CassandraRelevantProperties.AUTOREPAIR_ENABLE.getBoolean())
{
TABLE_NAMES = ImmutableSet.of(REPAIR_HISTORY,
PARENT_REPAIR_HISTORY, VIEW_BUILD_STATUS,
PARTITION_DENYLIST_TABLE, AUTO_REPAIR_HISTORY,
AUTO_REPAIR_PRIORITY);
}
else
{
TABLE_NAMES = ImmutableSet.of(REPAIR_HISTORY,
PARENT_REPAIR_HISTORY, VIEW_BUILD_STATUS,
PARTITION_DENYLIST_TABLE);
}
}
```
--
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]