Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
0.4.0
-----
* Change log level for logs in CassandraSchema to debug level to avoid log spamming (CASSANALYTICS-149)
* Pass SidecarCdcClient as a constructor parameter to avoid thread/resource leaks (CASSANALYTICS-142)
* Support extended deletion time in CDC for Cassandra 5.0
* Flush event consumer before persisting CDC state to prevent data loss on failure (CASSANALYTICS-126)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,10 +288,14 @@ public static void updateCdcSchema(@NotNull Schema schema,
@NotNull Partitioner partitioner,
@NotNull TableIdLookup tableIdLookup)
{
LOGGER.info("Updating CDC schema tables='{}'",
if (LOGGER.isDebugEnabled())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need explicit isDebugEnabled check? I believe LOGGER.debug work only when debug enabled right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yifan flagged that we do this following computation in the log. Even if debug logging is not enabled it gets computed if we don't have the check. This is an performance optimization

cdcTables.stream()
                 .map(t -> String.format("%s.%s", t.keyspace(), t.table()))
                 .collect(Collectors.joining(","))

{
LOGGER.debug("Updating CDC schema tables='{}'",
cdcTables.stream()
.map(t -> String.format("%s.%s", t.keyspace(), t.table()))
.collect(Collectors.joining(",")));
}

Map<String, Set<String>> cdcEnabledTables = CassandraSchema.cdcEnabledTables(schema);
for (CqlTable table : cdcTables)
{
Expand All @@ -301,7 +305,7 @@ public static void updateCdcSchema(@NotNull Schema schema,
if (cdcEnabledTables.containsKey(table.keyspace()) && cdcEnabledTables.get(table.keyspace()).contains(table.table()))
{
// table has cdc enabled already, update schema if it has changed
LOGGER.info("CDC already enabled keyspace={} table={}", table.keyspace(), table.table());
LOGGER.debug("CDC already enabled keyspace={} table={}", table.keyspace(), table.table());
cdcEnabledTables.get(table.keyspace()).remove(table.table());
CassandraSchema.maybeUpdateSchema(schema, partitioner, table, tableId, true);
Preconditions.checkArgument(CassandraSchema.isCdcEnabled(schema, table),
Expand Down
Loading