Interface StateStoreProvider
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
BKStateStoreProviderImpl,PulsarMetadataStateStoreProviderImpl
The State Store Provider provides the state stores for a function.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StateStoreProviderThe state store provider returns `null` state stores.static final String -
Method Summary
Modifier and TypeMethodDescriptiondefault voidClean up the state store with the provided store name.voidclose()<T extends StateStore>
TgetStateStore(String tenant, String namespace, String name) Get the state store with the provided store name.default voidInitialize the state store provider.default voidinit(Map<String, Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails) Deprecated.
-
Field Details
-
STATE_STORAGE_SERVICE_URL
- See Also:
-
NULL
The state store provider returns `null` state stores.
-
-
Method Details
-
init
@Deprecated default void init(Map<String, Object> config, org.apache.pulsar.functions.proto.Function.FunctionDetails functionDetails) throws ExceptionDeprecated.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
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 storenamespace- the namespace that owns this state storename- 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
Clean up the state store with the provided store name.- Parameters:
tenant- the tenant that owns this state storenamespace- the namespace that owns this state storename- the state store name- Throws:
Exception- when failed to clean up the state store provider.
-
close
void close()- Specified by:
closein interfaceAutoCloseable
-