Class TableViewLoadDataStoreImpl<T>
java.lang.Object
org.apache.pulsar.broker.loadbalance.extensions.store.TableViewLoadDataStoreImpl<T>
- Type Parameters:
T- Load data type.
- All Implemented Interfaces:
Closeable,AutoCloseable,LoadDataStore<T>
The load data store, base on
.-
Constructor Summary
ConstructorsConstructorDescriptionTableViewLoadDataStoreImpl(PulsarService pulsar, String topic, Class<T> clazz) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidCloses the table view.entrySet()Returns a Set view of the mappings contained in this map.voidforEach(BiConsumer<String, T> action) Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.Get load data by key.voidinit()Inits the data store (close and start the data store).Async push load data to store.removeAsync(String key) Async remove load data from store.voidshutdown()Shutdowns the data store.intsize()The load data key count.voidstart()Starts the data store (both producer and table view).voidStarts the producer.voidStarts the table view.
-
Constructor Details
-
TableViewLoadDataStoreImpl
public TableViewLoadDataStoreImpl(PulsarService pulsar, String topic, Class<T> clazz) throws LoadDataStoreException - Throws:
LoadDataStoreException
-
-
Method Details
-
pushAsync
Description copied from interface:LoadDataStoreAsync push load data to store.- Specified by:
pushAsyncin interfaceLoadDataStore<T>- Parameters:
key- The load data key.loadData- The load data.
-
removeAsync
Description copied from interface:LoadDataStoreAsync remove load data from store.- Specified by:
removeAsyncin interfaceLoadDataStore<T>- Parameters:
key- The load data key to remove.
-
get
Description copied from interface:LoadDataStoreGet load data by key.- Specified by:
getin interfaceLoadDataStore<T>- Parameters:
key- The load data key.
-
forEach
Description copied from interface:LoadDataStorePerforms the given action for each entry in this map until all entries have been processed or the action throws an exception.- Specified by:
forEachin interfaceLoadDataStore<T>- Parameters:
action- The action to be performed for each entry
-
entrySet
Description copied from interface:LoadDataStoreReturns a Set view of the mappings contained in this map.- Specified by:
entrySetin interfaceLoadDataStore<T>- Returns:
- a set view of the mappings contained in this map
-
size
public int size()Description copied from interface:LoadDataStoreThe load data key count.- Specified by:
sizein interfaceLoadDataStore<T>
-
init
Description copied from interface:LoadDataStoreInits the data store (close and start the data store).- Specified by:
initin interfaceLoadDataStore<T>- Throws:
IOException
-
closeTableView
Description copied from interface:LoadDataStoreCloses the table view.- Specified by:
closeTableViewin interfaceLoadDataStore<T>- Throws:
IOException
-
start
Description copied from interface:LoadDataStoreStarts the data store (both producer and table view).- Specified by:
startin interfaceLoadDataStore<T>- Throws:
LoadDataStoreException
-
startTableView
Description copied from interface:LoadDataStoreStarts the table view.- Specified by:
startTableViewin interfaceLoadDataStore<T>- Throws:
LoadDataStoreException
-
startProducer
Description copied from interface:LoadDataStoreStarts the producer.- Specified by:
startProducerin interfaceLoadDataStore<T>- Throws:
LoadDataStoreException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
shutdown
Description copied from interface:LoadDataStoreShutdowns the data store.- Specified by:
shutdownin interfaceLoadDataStore<T>- Throws:
IOException
-