当我更新列时 SSTable 会发生变化吗?
据我所知,所有插入操作都会首先到达commitlog,然后到达Memtable,然后将其压缩到SSTable。
压缩到 SSTable 后,我对现有列执行更新操作。 是否必须更改 SSTable
才能更新该列的值?
I understand that all insert operations will come to commitlog first, and Memtable
second, after that it will be compacted to SSTable
.
After compaction to SSTable
, I perform an update operation for an existing column.
Must the SSTable
be changed to update the value of that column?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
http://wiki.apache.org/cassandra/MemtableSSTable 说:
您更新的值将写入提交日志和内存表,并最终刷新到磁盘上的新 SSTable。稍后,这个SSTable可能会与其他SSTable合并,形成一个新的更大的SSTable(旧的将被丢弃)——这就是压缩阶段。
http://wiki.apache.org/cassandra/MemtableSSTable says:
Your updated value will be written to commitlog, and a memtable, and will eventually be flushed to a new SSTable on-disk. Later, this SSTable may be merged with other SSTables to form a new larger SSTable (and the old ones will be discarded) - this is the compaction stage.
回答您的后续问题:是的,或者不是 - 您的值可能最终会出现在不同的 SSTable 中,直到它们被压缩,但您不需要等到压缩才能获得“真实”值,因为您的不同版本值带有时间戳,因此 Cassandra 可以返回最新的值。
Answering your follow-up question: yes, and no - your values may end up in different SSTables until they are compacted, but you don't need to wait until a compaction to get the 'true' value, because the various versions of your value are timestamped, so Cassandra can return the most recent.