The "number of keys" is missing from the "nodetool cfstats" output in cassandra 2.1.2. How do I get the row count now?

I really need the number of rows in ColumnFamily, but "Number of Keys" is missing from the output of "nodetool cfstats" in cassandra 2.1.2. How do I get the row count now?

Here is the output from cfstats

Keyspace: liftrmt
    Read Count: 0
    Read Latency: NaN ms.
    Write Count: 0
    Write Latency: NaN ms.
    Pending Flushes: 0
            Table: reportcodedaycount
            SSTable count: 4
            Space used (live): 11.49 MB
            Space used (total): 11.49 MB
            Space used by snapshots (total): 0 bytes
            SSTable Compression Ratio: 0.38099920748493266
            Memtable cell count: 0
            Memtable data size: 0 bytes
            Memtable switch count: 0
            Local read count: 0
            Local read latency: NaN ms
            Local write count: 0
            Local write latency: NaN ms
            Pending flushes: 0
            Bloom filter false positives: 0
            Bloom filter false ratio: 0.00000
            Bloom filter space used: 64 bytes
            Compacted partition minimum bytes: 444.17 KB
            Compacted partition maximum bytes: 6.68 MB
            Compacted partition mean bytes: 4.17 MB
            Average live cells per slice (last five minutes): 0.0
            Maximum live cells per slice (last five minutes): 0.0
            Average tombstones per slice (last five minutes): 0.0
            Maximum tombstones per slice (last five minutes): 0.0

      

+3


source to share


2 answers


You need to use the new metrics that can be accessed through JMX. I will be accessing them using JConsole.

Open jconsole then navigate to:

org.apache.cassandra.metrics
    -> ColumnFamily
        -> ksname (in my case test)
            -> cfname (in my case group)
                -> EstimatedColumnCountHistogram
                    -> Attributes -> Value

      

Open long array [90], and in my case this is the second value. These are the keys that are in sstables, if they are in memory, it will not be accessible through this metric (i.e. if you want to see it, you need to dump your memtables to sstables).



Screenshot of 22 unique keys entered in test.group below for clarity ...

JConsole showing 22 inserted keys into cassandra

Learn more about the new Metrics API .

+4


source


UPDATE: This issue is now fixed in 2.1.3.



I went ahead and created a jira for this. Not sure why 2.1.2 is missing in the keys: https://issues.apache.org/jira/browse/CASSANDRA-8400

+1


source







All Articles