Class BKStateStoreProviderImpl
java.lang.Object
org.apache.pulsar.functions.instance.state.BKStateStoreProviderImpl
- All Implemented Interfaces:
AutoCloseable,StateStoreProvider
The state store provider that provides bookkeeper table backed state stores.
-
Field Summary
Fields inherited from interface org.apache.pulsar.functions.instance.state.StateStoreProvider
NULL, STATE_STORAGE_SERVICE_URL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidClean 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.voidInitialize the state store provider.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pulsar.functions.instance.state.StateStoreProvider
init
-
Constructor Details
-
BKStateStoreProviderImpl
public BKStateStoreProviderImpl()
-
-
Method Details
-
init
Description copied from interface:StateStoreProviderInitialize the state store provider.- Specified by:
initin interfaceStateStoreProvider- Parameters:
config- the config to init the state store provider.- Throws:
Exception- when failed to init the state store provider.
-
getStateStore
public <T extends StateStore> T getStateStore(String tenant, String namespace, String name) throws Exception Description copied from interface:StateStoreProviderGet the state store with the provided store name.- Specified by:
getStateStorein interfaceStateStoreProvider- 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
Description copied from interface:StateStoreProviderClean up the state store with the provided store name.- Specified by:
cleanUpin interfaceStateStoreProvider- 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
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceStateStoreProvider
-