public interface IProducer<O,R>
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<O> |
addUserRecord(R record)
This method should send data to an specific destination.
|
com.google.common.util.concurrent.ListenableFuture<O> |
addUserRecord(R record,
long operationTimeoutInMillis)
This method should send data to an specific destination
|
void |
destroy()
Destroy and release any used resource.
|
void |
flush()
This method flushes the buffer immediately.
|
void |
flushSync()
Performs a synchronous flush on the buffer waiting until the whole buffer is drained.
|
int |
getOutstandingRecordsCount()
Should return the number of outstanding records if the producer implements buffering.
|
boolean |
isDestroyed()
Returns whether the producer has been destroyed or not
|
boolean |
isFlushFailed()
A flag representing whether the flush has failed or not.
|
com.google.common.util.concurrent.ListenableFuture<O> addUserRecord(R record) throws Exception
record - the type of data to be sentListenableFuture with the result for the operation.Exceptioncom.google.common.util.concurrent.ListenableFuture<O> addUserRecord(R record, long operationTimeoutInMillis) throws Exception
record - the type of data to be sentoperationTimeoutInMillis - the expected operation timeoutListenableFuture with the result for the operation.Exceptionboolean isDestroyed()
int getOutstandingRecordsCount()
void flush()
void flushSync()
boolean isFlushFailed()
boolean representing whether the success of failure of flush buffer operation.Copyright © 2019. All rights reserved.