摘要 |
A system and method for cleaning a log structure, the log structure including one or more segments, each segment including live data, orders the one or more segments into a hot list according to age, with the youngest segment at the beginning of the hot list and the oldest segment at the end of the hot list, the youngest segment being the most recently used segment and the oldest segment being the least recently used segment, pushes one or more of the oldest segments in the hot list to a cleaning matrix, the cleaning matrix grouping segments according to age and percent of live data in the segment, traverses the cleaning matrix looking for a segment, determines whether enough live data has been found to write a complete segment, sequentially repeats the previous two processes until enough live data has been found to write a complete segment, reads data from the one or more found segments, and writes the read live data into an unused segment.
|