加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

cassandra 2.1.2中“nodetool cfstats”输出中缺少“键数”.现在

发布时间:2020-12-13 13:28:42 所属栏目:百科 来源:网络整理
导读:我非常需要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
我非常需要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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读