Class CompactionAwareWriter

    • Field Detail

      • logger

        protected static final org.slf4j.Logger logger
      • nonExpiredSSTables

        protected final java.util.Set<SSTableReader> nonExpiredSSTables
      • estimatedTotalKeys

        protected final long estimatedTotalKeys
      • maxAge

        protected final long maxAge
      • minRepairedAt

        protected final long minRepairedAt
      • pendingRepair

        protected final java.util.UUID pendingRepair
      • isTransient

        protected final boolean isTransient
    • Method Detail

      • estimatedKeys

        public long estimatedKeys()
        estimated number of keys we should write
      • append

        public final boolean append​(UnfilteredRowIterator partition)
        Writes a partition in an implementation specific way
        Parameters:
        partition - the partition to append
        Returns:
        true if the partition was written, false otherwise
      • maybeSwitchWriter

        protected void maybeSwitchWriter​(DecoratedKey key)
        Guaranteed to be called before the first call to realAppend.
        Parameters:
        key -
      • switchCompactionLocation

        protected abstract void switchCompactionLocation​(Directories.DataDirectory directory)
        Implementations of this method should finish the current sstable writer and start writing to this directory. Called once before starting to append and then whenever we see a need to start writing to another directory.
        Parameters:
        directory -
      • getDirectories

        public Directories getDirectories()
        The directories we can write to
      • getWriteDirectory

        public Directories.DataDirectory getWriteDirectory​(java.lang.Iterable<SSTableReader> sstables,
                                                           long estimatedWriteSize)
        Return a directory where we can expect expectedWriteSize to fit.
        Parameters:
        sstables - the sstables to compact
        Returns:
      • getExpectedWriteSize

        protected long getExpectedWriteSize()