@InterfaceAudience.Public
@InterfaceStability.Stable
public interface ConnectorContext
| Modifier and Type | Method and Description |
|---|---|
void |
deleteState(String key)
Delete the state value for the key.
|
CompletableFuture<Void> |
deleteStateAsync(String key)
Delete the state value for the key, but don't wait for the operation to be completed
|
long |
getCounter(String key)
Retrieve the counter value for the key.
|
CompletableFuture<Long> |
getCounterAsync(String key)
Retrieve the counter value for the key, but don't wait
for the operation to be completed
|
int |
getInstanceId()
The id of the instance that invokes this source.
|
org.slf4j.Logger |
getLogger()
The logger object that can be used to log in a sink
|
String |
getNamespace()
The namespace this source belongs to.
|
int |
getNumInstances()
Get the number of instances that invoke this source.
|
String |
getSecret(String secretName)
Get the secret associated with this key
|
ByteBuffer |
getState(String key)
Retrieve the state value for the key.
|
CompletableFuture<ByteBuffer> |
getStateAsync(String key)
Retrieve the state value for the key, but don't wait for the operation to be completed
|
default <S extends StateStore> |
getStateStore(String name)
Get the state store with the provided store name.
|
String |
getTenant()
The tenant this source belongs to.
|
void |
incrCounter(String key,
long amount)
Increment the builtin distributed counter referred by key.
|
CompletableFuture<Void> |
incrCounterAsync(String key,
long amount)
Increment the builtin distributed counter referred by key
but dont wait for the completion of the increment operation
|
void |
putState(String key,
ByteBuffer value)
Update the state value for the key.
|
CompletableFuture<Void> |
putStateAsync(String key,
ByteBuffer value)
Update the state value for the key, but don't wait for the operation to be completed
|
void |
recordMetric(String metricName,
double value)
Record a user defined metric
|
int getInstanceId()
int getNumInstances()
void recordMetric(String metricName, double value)
metricName - The name of the metricvalue - The value of the metricString getTenant()
String getNamespace()
org.slf4j.Logger getLogger()
String getSecret(String secretName)
secretName - The name of the secretdefault <S extends StateStore> S getStateStore(String name)
S - the type of interface of the store to returnname - the state store nameClassCastException - if the return type isn't a type
or interface of the actual returned store.void incrCounter(String key, long amount)
key - The name of the keyamount - The amount to be incrementedCompletableFuture<Void> incrCounterAsync(String key, long amount)
key - The name of the keyamount - The amount to be incrementedlong getCounter(String key)
key - name of the keyCompletableFuture<Long> getCounterAsync(String key)
key - name of the keyvoid putState(String key, ByteBuffer value)
key - name of the keyvalue - state value of the keyCompletableFuture<Void> putStateAsync(String key, ByteBuffer value)
key - name of the keyvalue - state value of the keyByteBuffer getState(String key)
key - name of the keyCompletableFuture<ByteBuffer> getStateAsync(String key)
key - name of the keyvoid deleteState(String key)
key - name of the keyCompletableFuture<Void> deleteStateAsync(String key)
key - name of the keyCopyright © 2017–2021 Apache Software Foundation. All rights reserved.