Class MarlinProducerResultImpl
- java.lang.Object
-
- com.mapr.kafka.eventstreams.impl.producer.MarlinProducerResultImpl
-
- All Implemented Interfaces:
com.mapr.fs.jni.MarlinProducerResult
- Direct Known Subclasses:
MarlinProducerResultImplV10
public class MarlinProducerResultImpl extends java.lang.Object implements com.mapr.fs.jni.MarlinProducerResultThis structure maintains all the data structures related to a producer request. Once marlin server comes back with a completion callback for a request then this request is marked done and populated with all the metadata coming from the server. The future returned to the caller waits on this done call to actually return the request metadata.
-
-
Field Summary
Fields Modifier and Type Field Description protected intfeedprotected longoffsetprotected intserializedKeySizeprotected intserializedValueSizeprotected longtimestampprotected java.lang.Stringtopic
-
Constructor Summary
Constructors Constructor Description MarlinProducerResultImpl(java.lang.String topic, int feed, org.apache.kafka.clients.producer.Callback callback, int serKeySz, int serValSz)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawait()Await the completion of this requestbooleanawait(long timeout, java.util.concurrent.TimeUnit unit)Await the completion of this request (up to the given time interval)org.apache.kafka.clients.producer.Callbackcallback()booleancompleted()Has the request completed?voiddone(int feedid, long offset, long timestamp, java.lang.Exception error)java.lang.Exceptionerror()The error thrown (generally on the server) while processing this requestintgetFeed()org.apache.kafka.clients.producer.RecordMetadatagetRecordMetadata()java.lang.StringgetTopic()longoffset()The base offset for the request (the first offset in the record set)voidonCompletion()
-
-
-
Method Detail
-
done
public void done(int feedid, long offset, long timestamp, java.lang.Exception error)- Specified by:
donein interfacecom.mapr.fs.jni.MarlinProducerResult
-
getTopic
public java.lang.String getTopic()
-
getFeed
public int getFeed()
-
getRecordMetadata
public org.apache.kafka.clients.producer.RecordMetadata getRecordMetadata()
-
await
public void await() throws java.lang.InterruptedExceptionAwait the completion of this request- Throws:
java.lang.InterruptedException
-
await
public boolean await(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedExceptionAwait the completion of this request (up to the given time interval)- Parameters:
timeout- The maximum time to waitunit- The unit for the max time- Returns:
- true if the request completed, false if we timed out
- Throws:
java.lang.InterruptedException
-
completed
public boolean completed()
Has the request completed?
-
offset
public long offset()
The base offset for the request (the first offset in the record set)
-
error
public java.lang.Exception error()
The error thrown (generally on the server) while processing this request
-
callback
public org.apache.kafka.clients.producer.Callback callback()
-
onCompletion
public void onCompletion()
- Specified by:
onCompletionin interfacecom.mapr.fs.jni.MarlinProducerResult
-
-