Interface StateStoreProvider
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Implementing Classes:
BKStateStoreProviderImpl,PulsarMetadataStateStoreProviderImpl
public interface StateStoreProvider extends java.lang.AutoCloseableThe State Store Provider provides the state stores for a function.
-
-
Field Summary
Fields Modifier and Type Field Description static StateStoreProviderNULLThe state store provider returns `null` state stores.static java.lang.StringSTATE_STORAGE_SERVICE_URL
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidclose()<S extends org.apache.pulsar.functions.api.StateStore>
SgetStateStore(java.lang.String tenant, java.lang.String namespace, java.lang.String name)Get the state store with the provided store name.default voidinit(java.util.Map<java.lang.String,java.lang.Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails)Initialize the state store provider.
-
-
-
Field Detail
-
STATE_STORAGE_SERVICE_URL
static final java.lang.String STATE_STORAGE_SERVICE_URL
- See Also:
- Constant Field Values
-
NULL
static final StateStoreProvider NULL
The state store provider returns `null` state stores.
-
-
Method Detail
-
init
default void init(java.util.Map<java.lang.String,java.lang.Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails) throws java.lang.ExceptionInitialize the state store provider.- Parameters:
config- the config to init the state store provider.functionDetails- the function details.- Throws:
java.lang.Exception- when failed to init the state store provider.
-
getStateStore
<S extends org.apache.pulsar.functions.api.StateStore> S getStateStore(java.lang.String tenant, java.lang.String namespace, java.lang.String name) throws java.lang.ExceptionGet the state store with the provided store name.- Type Parameters:
S- the type of interface of the store to return- Parameters:
tenant- the tenant that owns this state storenamespace- the namespace that owns this state storename- the state store name- Returns:
- the state store instance.
- Throws:
java.lang.ClassCastException- if the return type isn't a type or interface of the actual returned store.java.lang.Exception
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-