Cassandra 文件结构 - 文件是如何使用的? [英] Cassandra file structure - how are the files used?

查看:12
本文介绍了Cassandra 文件结构 - 文件是如何使用的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 Cassandra 进行试验时,我发现 Cassandra 会写入以下文件:

When experimenting with Cassandra I've observed that Cassandra writes to the following files:

/.../cassandra/commitlog/CommitLog-<id>.log
/.../cassandra/data/Keyspace1/Standard1-1-Data.db
/.../cassandra/data/Keyspace1/Standard1-1-Filter.db
/.../cassandra/data/Keyspace1/Standard1-1-Index.db
/.../cassandra/data/system/LocationInfo-1-Data.db
/.../cassandra/data/system/LocationInfo-1-Filter.db
/.../cassandra/data/system/LocationInfo-1-Index.db
/.../cassandra/data/system/LocationInfo-2-Data.db
/.../cassandra/data/system/LocationInfo-2-Filter.db
/.../cassandra/data/system/LocationInfo-2-Index.db
/.../cassandra/data/system/LocationInfo-3-Data.db
/.../cassandra/data/system/LocationInfo-3-Filter.db
/.../cassandra/data/system/LocationInfo-3-Index.db
/.../cassandra/system.log

一般结构似乎是:

/.../cassandra/commitlog/CommitLog-ID.log
/.../cassandra/data/KEYSPACE/COLUMN_FAMILY-N-Data.db
/.../cassandra/data/KEYSPACE/COLUMN_FAMILY-N-Filter.db
/.../cassandra/data/KEYSPACE/COLUMN_FAMILY-N-Index.db
/.../cassandra/system.log

什么是 Cassandra 文件结构?更具体地说,datacommitlog目录是如何使用的,data目录下的文件结构是怎样的(Data/Filter/Index)?

What is the Cassandra file structure? More specifically, how are the data, commitlog directories used, and what is the structure of the files in the data directory (Data/Filter/Index)?

推荐答案

对 Cassandra 节点的写入首先会命中 CommitLog(顺序).(然后,Cassandra 将值存储到称为 Memtables 的列族特定的内存数据结构中.每当超过一个可配置的阈值时,Memtables 就会刷新到磁盘.(1,memtable 中的数据大小.2,对象数量达到一定限制,3、memtable的生命周期到期.))

A write to a Cassandra node first hits the CommitLog (sequential). (Then Cassandra stores values to column-family specific, in-memory data structures called Memtables. The Memtables are flushed to disk whenever one of the configurable thresholds is exceeded. (1, datasize in memtable. 2, # of objects reach certain limit, 3, lifetime of a memtable expires.))

data 文件夹包含每个键空间的子文件夹.每个子文件夹包含三种文件:

The data folder contains a subfolder for each keyspace. Each subfolder contains three kind of files:

  • 数据文件:SSTable(命名法从谷歌借来的)代表排序字符串表,是一个文件键值字符串对(按键).
  • 索引文件:(键,偏移量)对(指向数据文件)
  • 布隆过滤器:数据文件中的所有键
  • Data files: An SSTable (nomenclature borrowed from Google) stands for Sorted Strings Table and is a file of key-value string pairs (sorted by keys).
  • Index file: (Key, offset) pairs (points into data file)
  • Bloom filter: all keys in data file

这篇关于Cassandra 文件结构 - 文件是如何使用的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆