public interface SinkContext
| Modifier and Type | Method and Description |
|---|---|
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
|
Collection<String> |
getInputTopics()
Get a list of all input topics
|
int |
getInstanceId()
The id of the instance that invokes this sink.
|
org.slf4j.Logger |
getLogger()
The logger object that can be used to log in a sink
|
String |
getNamespace()
The namespace this sink belongs to
|
int |
getNumInstances()
Get the number of instances that invoke this sink.
|
String |
getSecret(String secretName)
Get the secret associated with this key
|
String |
getSinkName()
The name of the sink that we are executing
|
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
|
String |
getTenant()
The tenant this sink 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 metricCollection<String> getInputTopics()
String getTenant()
String getNamespace()
String getSinkName()
org.slf4j.Logger getLogger()
String getSecret(String secretName)
secretName - The name of the secretvoid 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 keyCopyright © 2017–2019 Apache Software Foundation. All rights reserved.