Skip to content

CASSANALYTICS-52: Downgrade noisy TokenPartitioner partition/range maps to DEBUG#209

Open
tejaslodayadd wants to merge 2 commits into
apache:trunkfrom
tejaslodayadd:CASSANALYTICS-52-downgrade-tokenpartitioner-logs
Open

CASSANALYTICS-52: Downgrade noisy TokenPartitioner partition/range maps to DEBUG#209
tejaslodayadd wants to merge 2 commits into
apache:trunkfrom
tejaslodayadd:CASSANALYTICS-52-downgrade-tokenpartitioner-logs

Conversation

@tejaslodayadd
Copy link
Copy Markdown
Contributor

…ps to DEBUG

The partition map, reverse partition map, and initial-ranges log lines
in TokenPartitioner emit one entry per token; with the default 256
vnodes per node this produces tens of thousands of characters of log
output at INFO on every job startup, drowning out useful messages.

Lower these to DEBUG in both TokenPartitioner implementations
(cassandra-analytics-core bulk writer and cassandra-analytics-common
bulk reader). Also switch the two concatenated info strings in the
common variant to SLF4J placeholder form so the map's toString() is
not built when DEBUG is suppressed.

Scalar summaries ("Number of ranges", "Tasks to run",
"Calculated number of splits") remain at INFO.

Patch by Tejas Lodaya for CASSANALYTICS-52
LOGGER.info("Number of partitions {}", reversePartitionMap.size());
LOGGER.info("Partition map " + partitionMap);
LOGGER.info("Reverse partition map " + reversePartitionMap);
LOGGER.debug("Number of partitions {}", reversePartitionMap.size());
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.

I have found this information useful when debugging jobs in the past. I do agree that these log messages are not needed in the majority of case. I wonder if there's a better way to control when to log this information.

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.

probably a JavaDoc comment on calculateTokenRangeMap()?

@tejaslodayadd tejaslodayadd requested a review from frankgh May 18, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants