yifan-c commented on code in PR #200: URL: https://github.com/apache/cassandra-sidecar/pull/200#discussion_r1964761555
########## server/src/main/java/org/apache/cassandra/sidecar/db/schema/SidecarSchema.java: ########## @@ -117,81 +69,13 @@ public void ensureInitialized() } } - protected void reportSidecarSchemaInitialized() + public SidecarInternalKeyspace sidecarInternalKeyspace() { - vertx.eventBus().publish(ON_SIDECAR_SCHEMA_INITIALIZED.address(), "SidecarSchema initialized"); + return sidecarInternalKeyspace; } - /** - * Returns {@code true} when the schema should be created by this Sidecar instance. For schemas - * of type {@link ExecuteOnClusterLeaseholderOnly}, the schema creation is conditioned to whether - * the local Sidecar instance has claimed the cluster-wide lease. For all other types of schemas, - * the schemas will be created. - * - * @param schema the schema to test - * @return {@code true} if the schema should be created by this Sidecar instance, {@code false} otherwise - */ - protected boolean shouldCreateSchema(AbstractSchema schema) + public <T extends TableSchema> T tableSchema(Class<T> type) { - if (schema instanceof ExecuteOnClusterLeaseholderOnly) - { - return clusterLease.isClaimedByLocalSidecar(); - } - return true; - } - - /** - * Initializer that retries until sidecar schema is initialized. Once initialized, it un-schedules itself. - */ - private class SidecarSchemaInitializer implements PeriodicTask Review Comment: `SidecarSchemaInitializer` is moved to its own class file. -- 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: pr-unsubscr...@cassandra.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org For additional commands, e-mail: pr-h...@cassandra.apache.org