Class SSTableRewriter

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Transactional

    public class SSTableRewriter
    extends Transactional.AbstractTransactional
    implements Transactional
    Wraps one or more writers as output for rewriting one or more readers: every sstable_preemptive_open_interval we look in the summary we're collecting for the latest writer for the penultimate key that we know to have been fully flushed to the index file, and then double check that the key is fully present in the flushed data file. Then we move the starts of each reader forwards to that point, replace them in the Tracker, and attach a runnable for on-close (i.e. when all references expire) that drops the page cache prior to that key position hard-links are created for each partially written sstable so that readers opened against them continue to work past renaming of the temporary file, which is deleted once all readers against the hard-link have been closed. If for any reason the writer is rolled over, we immediately rename and fully expose the completed file in the Tracker. On abort, we restore the original lower bounds to the existing readers and delete any temporary files we had in progress, but leave any hard-links in place for the readers we opened, and clean-up when the readers finish as we would do if we had finished successfully.
    • Field Detail

      • disableEarlyOpeningForTests

        public static boolean disableEarlyOpeningForTests
    • Constructor Detail

      • SSTableRewriter

        @Deprecated(since="3.4")
        public SSTableRewriter​(ILifecycleTransaction transaction,
                               long maxAge,
                               long preemptiveOpenInterval,
                               boolean keepOriginals)
        Deprecated.
        See CASSANDRA-11148