Interface StoreBuilder<T extends StateStore>

Type Parameters:
T - the type of store to build

public interface StoreBuilder<T extends StateStore>
Build a StateStore wrapped with optional caching and logging.
  • Method Details

    • withCachingEnabled

      StoreBuilder<T> withCachingEnabled()
      Enable caching on the store.
      Returns:
      this
    • withCachingDisabled

      StoreBuilder<T> withCachingDisabled()
      Disable caching on the store.
      Returns:
      this
    • withLoggingEnabled

      StoreBuilder<T> withLoggingEnabled(Map<String,String> config)
      Maintain a changelog for any changes made to the store. Use the provided config to set the config of the changelog topic.
      Parameters:
      config - config applied to the changelog topic
      Returns:
      this
    • withLoggingDisabled

      StoreBuilder<T> withLoggingDisabled()
      Disable the changelog for store built by this StoreBuilder. This will turn off fault-tolerance for your store. By default the changelog is enabled.
      Returns:
      this
    • build

      T build()
      Build the store as defined by the builder.
      Returns:
      the built StateStore
    • logConfig

      Map<String,String> logConfig()
      Returns a Map containing any log configs that will be used when creating the changelog for the StateStore.

      Note: any unrecognized configs will be ignored by the Kafka brokers.

      Returns:
      Map containing any log configs to be used when creating the changelog for the StateStore If loggingEnabled returns false, this function will always return an empty map
    • loggingEnabled

      boolean loggingEnabled()
      Returns:
      true if the StateStore should have logging enabled
    • name

      String name()
      Return the name of this state store builder. This must be a valid Kafka topic name; valid characters are ASCII alphanumerics, '.', '_' and '-'.
      Returns:
      the name of this state store builder