You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "smiklosovic (via GitHub)" <gi...@apache.org> on 2025/03/19 12:05:31 UTC
[PR] CASSANDRA-20448 Make sstableexpiredblockers support human-readable output with SSTable sizes [cassandra]
smiklosovic opened a new pull request, #3993:
URL: https://github.com/apache/cassandra/pull/3993
patch by Stefan Miklosovic; reviewed by Brad Schoening for CASSANDRA-20448
Thanks for sending a pull request! Here are some tips if you're new here:
* Ensure you have added or run the [appropriate tests](https://cassandra.apache.org/_/development/testing.html) for your PR.
* Be sure to keep the PR description updated to reflect all changes.
* Write your PR title to summarize what this PR proposes.
* If possible, provide a concise example to reproduce the issue for a faster review.
* Read our [contributor guidelines](https://cassandra.apache.org/_/development/index.html)
* If you're making a documentation change, see our [guide to documentation contribution](https://cassandra.apache.org/_/development/documentation.html)
Commit messages should follow the following format:
```
<One sentence description, usually Jira title or CHANGES.txt summary>
<Optional lengthier description (context on patch)>
patch by <Authors>; reviewed by <Reviewers> for CASSANDRA-#####
Co-authored-by: Name1 <email1>
Co-authored-by: Name2 <email2>
```
The [Cassandra Jira](https://issues.apache.org/jira/projects/CASSANDRA/issues/)
--
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-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20448 Make sstableexpiredblockers support human-readable output with SSTable sizes [cassandra]
Posted by "bbotella (via GitHub)" <gi...@apache.org>.
bbotella commented on code in PR #3993:
URL: https://github.com/apache/cassandra/pull/3993#discussion_r2003416535
##########
src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:
##########
@@ -122,12 +135,37 @@ public static Multimap<SSTableReader, SSTableReader> checkForExpiredSSTableBlock
return blockers;
}
- private static String formatForExpiryTracing(Iterable<SSTableReader> sstables)
+ @VisibleForTesting
+ public static String formatForExpiryTracing(boolean humanReadable, Iterable<SSTableReader> sstables)
{
StringBuilder sb = new StringBuilder();
for (SSTableReader sstable : sstables)
- sb.append(String.format("[%s (minTS = %d, maxTS = %d, maxLDT = %d)]", sstable, sstable.getMinTimestamp(), sstable.getMaxTimestamp(), sstable.getMaxLocalDeletionTime())).append(", ");
+ {
+ long minTimestamp = sstable.getMinTimestamp();
+ long maxTimestamp = sstable.getMaxTimestamp();
+ long maxLocalDeletionTime = sstable.getMaxLocalDeletionTime();
+ if (humanReadable)
+ {
+ sb.append(format("[%s (minTS = %s, maxTS = %s, maxLDT = %s, diskSize = %s)]",
Review Comment:
Nit: I think extracting this string for the format will help with maintenance in the future, having to change it only once instead of here and on line 160.
##########
src/java/org/apache/cassandra/tools/SSTableExpiredBlockers.java:
##########
@@ -122,12 +135,37 @@ public static Multimap<SSTableReader, SSTableReader> checkForExpiredSSTableBlock
return blockers;
}
- private static String formatForExpiryTracing(Iterable<SSTableReader> sstables)
+ @VisibleForTesting
+ public static String formatForExpiryTracing(boolean humanReadable, Iterable<SSTableReader> sstables)
{
StringBuilder sb = new StringBuilder();
for (SSTableReader sstable : sstables)
- sb.append(String.format("[%s (minTS = %d, maxTS = %d, maxLDT = %d)]", sstable, sstable.getMinTimestamp(), sstable.getMaxTimestamp(), sstable.getMaxLocalDeletionTime())).append(", ");
+ {
+ long minTimestamp = sstable.getMinTimestamp();
+ long maxTimestamp = sstable.getMaxTimestamp();
+ long maxLocalDeletionTime = sstable.getMaxLocalDeletionTime();
+ if (humanReadable)
+ {
+ sb.append(format("[%s (minTS = %s, maxTS = %s, maxLDT = %s, diskSize = %s)]",
+ sstable,
+ minTimestamp != Long.MIN_VALUE && minTimestamp != Long.MAX_VALUE ? Instant.ofEpochMilli(minTimestamp) : minTimestamp,
+ maxTimestamp != Long.MIN_VALUE && minTimestamp != Long.MAX_VALUE ? Instant.ofEpochMilli(maxTimestamp) : maxTimestamp,
+ maxLocalDeletionTime != Long.MAX_VALUE ? Instant.ofEpochSecond(maxLocalDeletionTime) : maxLocalDeletionTime,
+ FileUtils.stringifyFileSize(sstable.onDiskLength())))
+ .append(", ");
Review Comment:
The `append(", ")` can be out of the ifelse to avoid repetition.
--
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-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org
Re: [PR] CASSANDRA-20448 Make sstableexpiredblockers support human-readable output with SSTable sizes [cassandra]
Posted by "smiklosovic (via GitHub)" <gi...@apache.org>.
smiklosovic merged PR #3993:
URL: https://github.com/apache/cassandra/pull/3993
--
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-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org