例如,我已将数据存储到Cassandra 密钥空间 playerinfo
info
中
在cqlsh
中,有没有办法显示该列族的简要说明?它可以显示键下已有多少个键和列已存储在该列族中。
答案 0 :(得分:1)
我不知道如何在cqlsh中执行此操作,但是从命令提示符处,您应该能够通过执行nodetool cfstats
来获取该信息:
$ nodetool cfstats myKeyspace.myColumnFamily
Keyspace: myKeyspace
Read Count: 3
Read Latency: 3.552 ms.
Write Count: 8
Write Latency: 0.321375 ms.
Pending Tasks: 0
Table: myColumnFamily
SSTable count: 1
Space used (live), bytes: 6724
Space used (total), bytes: 6724
SSTable Compression Ratio: 0.2571466917192323
Number of keys (estimate): 128
Memtable cell count: 0
Memtable data size, bytes: 0
Memtable switch count: 1
Local read count: 3
Local read latency: 0.000 ms
Local write count: 8
Local write latency: 0.000 ms
Pending tasks: 0
Bloom filter false positives: 0
Bloom filter false ratio: 0.00000
Bloom filter space used, bytes: 16
Compacted partition minimum bytes: 6867
Compacted partition maximum bytes: 8239
Compacted partition mean bytes: 8239
Average live cells per slice (last five minutes): 5.0
Average tombstones per slice (last five minutes): 6.0
因此,在您的情况下,请尝试$ nodetool cfstats info.playerinfo
并查看是否能为您提供您正在寻找的内容。
答案 1 :(得分:1)
您可以尝试以下命令,该命令将提供您的columnfamily的完整描述。
DESCRIBE COLUMNFAMILY keyspace.columnfamily(info.playerinfo);
它将列出所有列,包括主键,二级索引。
如下所示。
cqlsh:事件> DESCRIBE COLUMNFAMILY events.standardevents1103;
CREATE TABLE standardevents1103(uuid uuid PRIMARY KEY,data 文本,名称文本,时间文本,跟踪器文本,类型文本,用户ID 文字)与
bloom_filter_fp_chance = 0.010000和
缓存=' KEYS_ONLY'和评论=''和
dclocal_read_repair_chance = 0.000000 AND gc_grace_seconds = 864000 AND read_repair_chance = 0.100000 AND replicate_on_write ='真'和
populate_io_cache_on_flush ='假'和
压实= {'类&#39 ;: ' SizeTieredCompactionStrategy'}和
压缩= {' sstable_compression':' SnappyCompressor'};