Interface StateStore

    • Method Detail

      • name

        java.lang.String name()
        The name of this store.
        Returns:
        the storage name
      • init

        void init​(ProcessorContext context,
                  StateStore root)
        Initializes this state store.

        The implementation of this function must register the root store in the context via the ProcessorContext.register(StateStore, StateRestoreCallback) function, where the first StateStore parameter should always be the passed-in root object, and the second parameter should be an object of user's implementation of the StateRestoreCallback interface used for restoring the state store from the changelog.

        Note that if the state store engine itself supports bulk writes, users can implement another interface BatchingStateRestoreCallback which extends StateRestoreCallback to let users implement bulk-load restoration logic instead of restoring one record at a time.

        Throws:
        java.lang.IllegalStateException - If store gets registered after initialized is already finished
        StreamsException - if the store's change log does not contain the partition
      • flush

        void flush()
        Flush any cached data
      • close

        void close()
        Close the storage engine. Note that this function needs to be idempotent since it may be called several times on the same state store.

        Users only need to implement this function but should NEVER need to call this api explicitly as it will be called by the library automatically when necessary

      • persistent

        boolean persistent()
        Return if the storage is persistent or not.
        Returns:
        true if the storage is persistent—false otherwise
      • isOpen

        boolean isOpen()
        Is this store open for reading and writing
        Returns:
        true if the store is open