尽管使用了 LZ4Compressor,但 Cassandra 压缩比为 0

Cassandra Compression Ratio is 0 although LZ4Compressor used

我已经创建了一个键空间并在其中 table 用于文档存储。 我使用的代码是

CREATE KEYSPACE space WITH replication = {'class':'SimpleStrategy', 'replication_factor' : 3};

USE space;

CREATE TABLE documents (
              doc_id text,
              path text,
          content text,
              metadata_id text,
              PRIMARY KEY (doc_id)
            )
            WITH compression = { 'sstable_compression' : 'LZ4Compressor' };

然后我将一些数据推入其中并使用命令 nodetool cfstats orpd.documents 我想检查压缩率。

$ nodetool cfstats space.documents
Keyspace: space
        Read Count: 0
        Read Latency: NaN ms.
        Write Count: 2005
        Write Latency: 0.050547132169576056 ms.
        Pending Flushes: 0
                Table: documents
                SSTable count: 0
                Space used (live): 0
                Space used (total): 0
                Space used by snapshots (total): 0
                Off heap memory used (total): 0
                SSTable Compression Ratio: 0.0
                Number of keys (estimate): 978
                Memtable cell count: 8020
                Memtable data size: 92999622
                Memtable off heap memory used: 0
                Memtable switch count: 0
                Local read count: 0
                Local read latency: NaN ms
                Local write count: 2005
                Local write latency: 0.051 ms
                Pending flushes: 0
                Bloom filter false positives: 0
                Bloom filter false ratio: 0.00000
                Bloom filter space used: 0
                Bloom filter off heap memory used: 0
                Index summary off heap memory used: 0
                Compression metadata off heap memory used: 0
                Compacted partition minimum bytes: 0
                Compacted partition maximum bytes: 0
                Compacted partition mean bytes: 0
                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

----------------

然而,我感到困惑,因为比率是 0.0,即使我使用了压缩器。 我很好奇是否需要将更多数据放入数据库才能获得测量值,或者我做错了什么。

你所有的数据都在内存表中 运行 下面的命令将你的 memtable 数据刷新到 sstable

nodetool flush