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

Szy*_*ski 1 compression data-compression cassandra nosql

我在其中创建了一个用于文档存储的键空间和表.我用的代码是

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' };
Run Code Online (Sandbox Code Playgroud)

然后我将一些数据推入其中并使用命令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

----------------
Run Code Online (Sandbox Code Playgroud)

然而,我感到困惑,因为比率是0.0,即使我使用压缩机.我很好奇是否需要将更多数据放入数据库以获取度量或者我做错了.

Ash*_*lam 5

您的所有数据都在memtable中运行以下命令将您的memtable数据刷新为sstable

nodetool flush 
Run Code Online (Sandbox Code Playgroud)