2. The Two Component LSM-Tree Algorithm(1)
An LSM-tree is composed of two or more tree-like component data structures.
一个LSM-tree是有两个或更多类似的树构成。
We deal in this Section with the simple two component case and assume in what follows that LSM-tree is indexing rows in a History table as in Example 1.2.
本节分析两个组件的情况,并且假定内容是历史表索引。
See Figure 2.1, below.
见图2.1.
A two component LSM-tree has a smaller component which is entirely memory resident, known as the C0 tree (or C0 component), and a larger component which is resident on disk, known as the C1 tree (or C1 component).
两个组件的的LSM-tree有一个更小内存存储的C0树和一个大点的磁盘存储的C1树组成。
Although the C1 component is disk resident, frequently referenced page nodes in C1 will remain in memory buffers as usual (buffers not shown), so that popular high level directory nodes of C1 can be counted on to be memory resident.
虽然C1时磁盘存储,频繁使用的C1内容会保存到内存中,所以C1中高层次目录可以当做在内存中看待。
As each new History row is generated, a log record to recover this insert is first written to the sequential log file in the usual way.
每次新行插入会先以一般方式写入日志到log文件。
The index entry for the History row is then inserted into the memory resident C0 tree, after which it will in time migrate out to the C1 tree on disk;
索引先插入C0,之后会迁移内容到C1树的磁盘上。
any search for an index entry will look first in C0 and then in C1.
搜索先从C0开始,再写入C1.
There is a certain amount of latency (delay) before entries in the C0 tree migrate out to the disk resident C1 tree, implying a need for recovery of index entries that don't get out to disk prior to a crash.
在C0树中的条目迁移到磁盘所在的C1树之前,存在一定的延迟(延迟),这意味着需要恢复在崩溃之前没有迁移到磁盘的索引条目。
Recovery is dis- cussed in Section 4, but for now we simply note that the log records that allow us to recover new inserts of History rows can be treated as logical logs; during recovery we can reconstruct the History rows that have been inserted and simultaneously recreate any needed entries to index these rows to recapture the lost content of C0.
恢复将在第4节中讨论,但现在我们只注意允许我们恢复History行新插入的日志记录可以被视为逻辑日志;在恢复期间,我们可以重构已插入的History行,并同时重新创建索引这些行所需的任何条目,以重新获取C0丢失的内容。(有道翻译)