cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From marc...@apache.org
Subject cassandra git commit: Add compressor name in the output of sstablemetadata
Date Fri, 11 Dec 2015 13:39:02 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk 105ccb3d2 -> 2cd18ef5a


Add compressor name in the output of sstablemetadata

Patch by Nicolas Lalevee; reviewed by marcuse for CASSANDRA-9879


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/2cd18ef5
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/2cd18ef5
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/2cd18ef5

Branch: refs/heads/trunk
Commit: 2cd18ef5a01a06d90e13e61971e5601c7de61e7c
Parents: 105ccb3
Author: Nicolas LaleveĢe <nicolas.lalevee@hibnet.org>
Authored: Thu Jul 23 15:05:00 2015 +0200
Committer: Marcus Eriksson <marcuse@apache.org>
Committed: Fri Dec 11 14:38:34 2015 +0100

----------------------------------------------------------------------
 CHANGES.txt                                               |  1 +
 debian/cassandra.install                                  |  1 +
 .../org/apache/cassandra/tools/SSTableMetadataViewer.java | 10 +++++++++-
 3 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2cd18ef5/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index dda12ba..296d3cd 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.2
+ * Add compressor name in sstablemetadata output (CASSANDRA-9879)
  * Fix type casting for counter columns (CASSANDRA-10824)
  * Prevent running Cassandra as root (CASSANDRA-8142)
  * bound maximum in-flight commit log replay mutation bytes to 64 megabytes (CASSANDRA-8639)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2cd18ef5/debian/cassandra.install
----------------------------------------------------------------------
diff --git a/debian/cassandra.install b/debian/cassandra.install
index 1b66426..9bc05d9 100644
--- a/debian/cassandra.install
+++ b/debian/cassandra.install
@@ -19,6 +19,7 @@ bin/cqlsh.py usr/bin
 bin/sstablescrub usr/bin
 bin/sstableupgrade usr/bin
 tools/bin/cassandra-stress usr/bin
+tools/bin/sstablemetadata usr/bin
 lib/*.jar usr/share/cassandra/lib
 lib/*.zip usr/share/cassandra/lib
 lib/sigar-bin/* usr/share/cassandra/lib/sigar-bin

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2cd18ef5/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java b/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
index 3728d34..5b47004 100644
--- a/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
+++ b/src/java/org/apache/cassandra/tools/SSTableMetadataViewer.java
@@ -23,6 +23,8 @@ import java.io.PrintStream;
 import java.util.EnumSet;
 import java.util.Map;
 
+import org.apache.cassandra.io.compress.CompressionMetadata;
+import org.apache.cassandra.io.sstable.Component;
 import org.apache.cassandra.io.sstable.Descriptor;
 import org.apache.cassandra.io.sstable.metadata.*;
 
@@ -54,6 +56,10 @@ public class SSTableMetadataViewer
                 ValidationMetadata validation = (ValidationMetadata) metadata.get(MetadataType.VALIDATION);
                 StatsMetadata stats = (StatsMetadata) metadata.get(MetadataType.STATS);
                 CompactionMetadata compaction = (CompactionMetadata) metadata.get(MetadataType.COMPACTION);
+                CompressionMetadata compression = null;
+                File compressionFile = new File(descriptor.filenameFor(Component.COMPRESSION_INFO));
+                if (compressionFile.exists())
+                    compression = CompressionMetadata.create(fname);
 
                 out.printf("SSTable: %s%n", descriptor);
                 if (validation != null)
@@ -66,7 +72,9 @@ public class SSTableMetadataViewer
                     out.printf("Minimum timestamp: %s%n", stats.minTimestamp);
                     out.printf("Maximum timestamp: %s%n", stats.maxTimestamp);
                     out.printf("SSTable max local deletion time: %s%n", stats.maxLocalDeletionTime);
-                    out.printf("Compression ratio: %s%n", stats.compressionRatio);
+                    out.printf("Compressor: %s%n", compression != null ? compression.compressor().getClass().getName()
: "-");
+                    if (compression != null)
+                        out.printf("Compression ratio: %s%n", stats.compressionRatio);
                     out.printf("Estimated droppable tombstones: %s%n", stats.getEstimatedDroppableTombstoneRatio((int)
(System.currentTimeMillis() / 1000)));
                     out.printf("SSTable Level: %d%n", stats.sstableLevel);
                     out.printf("Repaired at: %d%n", stats.repairedAt);


Mime
View raw message