|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.kafka.clients.producer.internals.ProduceRequestResult
public final class ProduceRequestResult
A class that models the future completion of a produce request for a single partition. There is one of these per
partition in a produce request and it is shared by all the RecordMetadata
instances that are batched together
for the same partition in the request.
Constructor Summary | |
---|---|
ProduceRequestResult()
|
Method Summary | |
---|---|
void |
await()
Await the completion of this request |
boolean |
await(long timeout,
java.util.concurrent.TimeUnit unit)
Await the completion of this request (up to the given time interval) |
long |
baseOffset()
The base offset for the request (the first offset in the record set) |
boolean |
completed()
Has the request completed? |
void |
done(TopicPartition topicPartition,
long baseOffset,
java.lang.RuntimeException error)
Mark this request as complete and unblock any threads waiting on its completion. |
java.lang.RuntimeException |
error()
The error thrown (generally on the server) while processing this request |
TopicPartition |
topicPartition()
The topic and partition to which the record was appended |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProduceRequestResult()
Method Detail |
---|
public void done(TopicPartition topicPartition, long baseOffset, java.lang.RuntimeException error)
topicPartition
- The topic and partition to which this record set was sent was sentbaseOffset
- The base offset assigned to the recorderror
- The error that occurred if there was one, or null.public void await() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean await(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- The maximum time to waitunit
- The unit for the max time
java.lang.InterruptedException
public long baseOffset()
public java.lang.RuntimeException error()
public TopicPartition topicPartition()
public boolean completed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |