Class LocalStateStore

    • Constructor Detail

      • LocalStateStore

        public LocalStateStore()
    • Method Detail

      • of

        public static LocalStateStore of​(String fileName)
                                  throws InvalidPathException
        Initialize a local state store based on the provided file name.
        Parameters:
        fileName - the name of the state file.
        Returns:
        the state store.
        Throws:
        InvalidPathException - if the provided file name cannot be resolved to a valid file
      • of

        public static LocalStateStore of​(Path fileName)
                                  throws InvalidPathException
        Initialize a local state store based on the provided Path.
        Parameters:
        fileName - the Path of the state file.
        Returns:
        the state store.
        Throws:
        InvalidPathException - if the provided Path name cannot be resolved to a valid file.
      • withMaxCommitInterval

        public LocalStateStore withMaxCommitInterval​(Duration interval)
        Sets the max commit interval. When you activate the commit background thread via AbstractStateStore.start(), the state will be committed to persistent storage at least every commit interval. The default max commit interval is 20 seconds.
        Parameters:
        interval - The target max upload interval.
        Returns:
        The LocalStateStore with the upload interval configured.