Class DuplicatingCheckpointOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class DuplicatingCheckpointOutputStream
    extends CheckpointStateOutputStream
    A CheckpointStateOutputStream that wraps a primary and a secondary CheckpointStateOutputStream and duplicates all writes into both streams. This stream applies buffering to reduce the amount of dual-method calling. Furthermore, exceptions that happen in interactions with the secondary stream are not exposed, until the user calls closeAndGetSecondaryHandle(). In contrast to that, exceptions from interactions with the primary stream are immediately returned to the user. This class is used to write state for local recovery as a local (secondary) copy of the (primary) state snapshot that is written to a (slower but highly-available) remote filesystem.