Interface StateStoreProvider

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
BKStateStoreProviderImpl, PulsarMetadataStateStoreProviderImpl

public interface StateStoreProvider extends AutoCloseable
The State Store Provider provides the state stores for a function.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final StateStoreProvider
    The state store provider returns `null` state stores.
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    cleanUp(String tenant, String namespace, String name)
    Clean up the state store with the provided store name.
    void
     
    <T extends StateStore>
    T
    getStateStore(String tenant, String namespace, String name)
    Get the state store with the provided store name.
    default void
    init(Map<String,Object> config)
    Initialize the state store provider.
    default void
    init(Map<String,Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails)
    Deprecated.
  • Field Details

  • Method Details

    • init

      @Deprecated default void init(Map<String,Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails) throws Exception
      Deprecated.
      Initialize the state store provider.
      Parameters:
      config - the config to init the state store provider.
      functionDetails - the function details.
      Throws:
      Exception - when failed to init the state store provider.
    • init

      default void init(Map<String,Object> config) throws Exception
      Initialize the state store provider.
      Parameters:
      config - the config to init the state store provider.
      Throws:
      Exception - when failed to init the state store provider.
    • getStateStore

      <T extends StateStore> T getStateStore(String tenant, String namespace, String name) throws Exception
      Get the state store with the provided store name.
      Type Parameters:
      T - the type of interface of the store to return
      Parameters:
      tenant - the tenant that owns this state store
      namespace - the namespace that owns this state store
      name - the state store name
      Returns:
      the state store instance.
      Throws:
      ClassCastException - if the return type isn't a type or interface of the actual returned store.
      Exception
    • cleanUp

      default void cleanUp(String tenant, String namespace, String name) throws Exception
      Clean up the state store with the provided store name.
      Parameters:
      tenant - the tenant that owns this state store
      namespace - the namespace that owns this state store
      name - the state store name
      Throws:
      Exception - when failed to clean up the state store provider.
    • close

      void close()
      Specified by:
      close in interface AutoCloseable