Skip to content

Commit

Permalink
Added deletion times to ic-sstables
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Zemek committed Aug 28, 2018
1 parent 3d4dae1 commit 37ab862
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ Print out sstable metadata for a column family. Useful in helping to tune compac
| Min Timestamp | Minimum cell timestamp contained in the sstable |
| Max Timestamp | Maximum cell timestamp contained in the sstable |
| Duration | The time span between minimum and maximum cell timestamps |
| Max Deletion Time | The maximum deletion time |
| Level | Leveled Tiered Compaction sstable level |
| Keys | Number of partition keys |
| Avg Partition Size | Average partition size |
Expand Down
2 changes: 2 additions & 0 deletions src/com/instaclustr/sstabletools/SSTableMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public int compare(SSTableMetadata o1, SSTableMetadata o2) {

public long maxTimestamp;

public int maxLocalDeletionTime;

public long fileTimestamp;

public long diskLength;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public static void main(String[] args) {
"Max Timestamp",
"File Timestamp",
"Duration",
"Max Deletion Time",
"Level",
"Keys",
"Avg Partition Size",
Expand All @@ -73,6 +74,7 @@ public static void main(String[] args) {
Util.UTC_DATE_FORMAT.format(new Date(metadata.maxTimestamp / 1000)),
Util.UTC_DATE_FORMAT.format(new Date(metadata.fileTimestamp)),
Util.humanReadableDateDiff(metadata.minTimestamp / 1000, metadata.maxTimestamp / 1000),
metadata.maxLocalDeletionTime != Integer.MAX_VALUE ? Util.UTC_DATE_FORMAT.format(new Date(metadata.maxLocalDeletionTime * 1000L)) : "",
Integer.toString(metadata.level),
Long.toString(metadata.keys),
Util.humanReadableByteCount(metadata.avgRowSize),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
}
tableMetadata.minTimestamp = table.getMinTimestamp();
tableMetadata.maxTimestamp = table.getMaxTimestamp();
tableMetadata.maxLocalDeletionTime = table.getSSTableMetadata().maxLocalDeletionTime;
tableMetadata.diskLength = table.onDiskLength();
tableMetadata.uncompressedLength = table.uncompressedLength();
tableMetadata.keys = table.estimatedKeys();
Expand Down

0 comments on commit 37ab862

Please sign in to comment.