retain

abstract fun retain(liveSegments: Set<Long>)

The segments the live version names, as of now.

Anything absent has left the tree and will never be read again, so whatever was derived from it can be dropped. Called after every change to the set of live segments and once when a store finishes recovery.

Note the ordering trap for an implementation that deletes files here: this is called during DocumentStore.open, which is before an implementation attached to the store has had a chance to load anything of its own. Deleting on the first call would delete derived data that has not been read yet.