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 11cb5fa commit 498ef44
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ 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 |
| Min Deletion Time | The minimum deletion time |
| 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
4 changes: 4 additions & 0 deletions src/com/instaclustr/sstabletools/SSTableMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public int compare(SSTableMetadata o1, SSTableMetadata o2) {

public long maxTimestamp;

public int minLocalDeletionTime;

public int maxLocalDeletionTime;

public long fileTimestamp;

public long diskLength;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public static void main(String[] args) {
"Max Timestamp",
"File Timestamp",
"Duration",
"Min Deletion Time",
"Max Deletion Time",
"Level",
"Keys",
"Avg Partition Size",
Expand Down Expand Up @@ -89,6 +91,8 @@ 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.minLocalDeletionTime != Integer.MAX_VALUE ? Util.UTC_DATE_FORMAT.format(new Date(metadata.minLocalDeletionTime * 1000L)) : "",
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 @@ -98,6 +98,8 @@ public List<SSTableMetadata> getSSTableMetadata(String ksName, String cfName) {
}
tableMetadata.minTimestamp = table.getMinTimestamp();
tableMetadata.maxTimestamp = table.getMaxTimestamp();
tableMetadata.minLocalDeletionTime = table.getSSTableMetadata().minLocalDeletionTime;
tableMetadata.maxLocalDeletionTime = table.getSSTableMetadata().maxLocalDeletionTime;
tableMetadata.diskLength = table.onDiskLength();
tableMetadata.uncompressedLength = table.uncompressedLength();
tableMetadata.keys = table.estimatedKeys();
Expand Down

0 comments on commit 498ef44

Please sign in to comment.