在cassandra 2.1.2中,“nodetool cfstats”输出中缺少“键数”。现在如何获取行数计数?

4

我非常需要知道一个ColumnFamily中的行数,但是在cassandra 2.1.2版本中,“nodetool cfstats”输出中缺少“Number of Keys”。现在如何获取行数?

以下是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
2个回答

4

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

打开JConsole,然后导航到:

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

打开长为[90]的数组,在我的情况下是第二个值。这些是在sstables中的键,如果它在memtable中,则无法通过此指标访问(即,如果您想查看它,则需要将memtables刷新到sstables)。
以下是插入到test.group中的22个唯一键的截图,以便更清楚地显示...

JConsole showing 22 inserted keys into cassandra

更多关于新指标 API的信息。


只是一条信息...如果有人没有x-server(GUI)来运行JConsole,那么他可以直接从命令行使用jmxterm。 - thunder

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接