close

open override fun close()

Releases every mapping, after stopping any background build.

The build is stopped first, and it has to be: a pass that was still running would go on writing sidecars and calling reopen into a catalog that has already let go of them. reopen would notice and orphan them, so nothing would break — but the segment's work would be thrown away and, on Windows, a mapping could still be live when a caller tries to remove the directory. Stopping is bounded by one segment, because that is the granularity a build can be cancelled at.

Nothing is deleted. A catalog releases rather than retires, because shutting down is not departing and hanging deletion off "the last reference went" would make closing a catalog delete the sidecars of a store that is merely stopping.