Interface StateChangelogWriter<Handle extends ChangelogStateHandle>

    • Method Detail

      • appendMeta

        void appendMeta​(byte[] value)
                 throws IOException
        Appends the provided **metadata** to this log. No persistency guarantees.
        Throws:
        IOException
      • append

        void append​(int keyGroup,
                    byte[] value)
             throws IOException
        Appends the provided data to this log. No persistency guarantees.
        Throws:
        IOException
      • truncate

        void truncate​(SequenceNumber to)
        Truncate this state changelog to free up the resources and collect any garbage. That means:
        • Discard the written state changes - in the provided range [from; to)
        • Truncate the in-memory view of this changelog - in the range [0; to)
        Called upon state materialization. Any ongoing persist calls will not be affected.

        WARNING: the range [from; to) must not include any range that is included into any checkpoint that is not subsumed or aborted.

        Parameters:
        to - exclusive
      • confirm

        void confirm​(SequenceNumber from,
                     SequenceNumber to,
                     long checkpointId)
        Mark the given state changes as confirmed by the JM.
        Parameters:
        from - inclusive
        to - exclusive
        checkpointId - to confirm
      • reset

        void reset​(SequenceNumber from,
                   SequenceNumber to,
                   long checkpointId)
        Reset the state the given state changes. Called upon abortion so that if requested later then these changes will be re-uploaded.
      • truncateAndClose

        void truncateAndClose​(SequenceNumber from)
        Truncate the tail of log and close it. No new appends will be possible. Any appended but not persisted records will be lost.
        Parameters:
        from - SequenceNumber from which to truncate the changelog, inclusive
      • close

        void close()
        Close this log. No new appends will be possible. Any appended but not persisted records will be lost.
        Specified by:
        close in interface AutoCloseable