微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

cassandra 2.1.2中“nodetool cfstats”输出中缺少“键数”.现在如何计算行数?

我非常需要ColumnFamily中的行数,但cassandra 2.1.2中的“nodetool cfstats”输出中缺少“键数”.现在如何计算行数?

这是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

解决方法

您需要使用可通过JMX访问的新指标.我将使用JConsole访问它们.

打开jconsole然后导航到:

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

打开long [90]数组,在我的例子中它是第二个值.这些是sstables中的键,如果它在memtable中,它不能通过这个度量访问(即如果你想看到它,你需要将你的memtables刷新到sstables).

为了清楚起见,下面插入test.group的22个唯一键的屏幕截图…

更多关于new metrics API.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐