public class BKStateStoreImpl extends Object implements DefaultStateStore
currently it exposes incr operations. but we can expose other key/values operations if needed.
| Constructor and Description |
|---|
BKStateStoreImpl(String tenant,
String namespace,
String name,
org.apache.bookkeeper.api.kv.Table<io.netty.buffer.ByteBuf,io.netty.buffer.ByteBuf> table) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
delete(String key) |
CompletableFuture<Void> |
deleteAsync(String key) |
String |
fqsn() |
ByteBuffer |
get(String key) |
CompletableFuture<ByteBuffer> |
getAsync(String key) |
long |
getCounter(String key) |
CompletableFuture<Long> |
getCounterAsync(String key) |
void |
incrCounter(String key,
long amount) |
CompletableFuture<Void> |
incrCounterAsync(String key,
long amount) |
void |
init(StateStoreContext ctx) |
String |
name() |
String |
namespace() |
void |
put(String key,
ByteBuffer value) |
CompletableFuture<Void> |
putAsync(String key,
ByteBuffer value) |
String |
tenant() |
public String tenant()
tenant in interface StateStorepublic String namespace()
namespace in interface StateStorepublic String name()
name in interface StateStorepublic String fqsn()
fqsn in interface StateStorepublic void init(StateStoreContext ctx)
init in interface StateStorepublic void close()
close in interface AutoCloseableclose in interface StateStorepublic CompletableFuture<Void> incrCounterAsync(String key, long amount)
incrCounterAsync in interface CounterStateStorepublic void incrCounter(String key, long amount)
incrCounter in interface CounterStateStorepublic CompletableFuture<Long> getCounterAsync(String key)
getCounterAsync in interface CounterStateStorepublic long getCounter(String key)
getCounter in interface CounterStateStorepublic CompletableFuture<Void> putAsync(String key, ByteBuffer value)
putAsync in interface ByteBufferStateStorepublic void put(String key, ByteBuffer value)
put in interface ByteBufferStateStorepublic CompletableFuture<Void> deleteAsync(String key)
deleteAsync in interface ByteBufferStateStorepublic void delete(String key)
delete in interface ByteBufferStateStorepublic CompletableFuture<ByteBuffer> getAsync(String key)
getAsync in interface ByteBufferStateStorepublic ByteBuffer get(String key)
get in interface ByteBufferStateStoreCopyright © 2017–2021 Apache Software Foundation. All rights reserved.