public class ClaimedFragmentBatch extends Object
nextFragment(int, int) to add a new
fragment to the batch. Write the fragment message using getBuffer() and getFragmentOffset() to get the buffer offset of this fragment. Complete the whole batch
operation by calling either commit() or abort().
The claimed batch is reusable but not thread-safe.
| Constructor and Description |
|---|
ClaimedFragmentBatch() |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Commit all fragments of the batch and mark them as failed.
|
void |
commit()
Commit all fragments of the batch so that it can be read by subscriptions.
|
org.agrona.MutableDirectBuffer |
getBuffer() |
int |
getFragmentOffset() |
long |
nextFragment(int length,
int streamId)
Add a new fragment to the batch.
|
void |
wrap(org.agrona.concurrent.UnsafeBuffer underlyingbuffer,
int partitionId,
int fragmentOffset,
int fragmentLength,
Runnable onCompleteHandler) |
public void wrap(org.agrona.concurrent.UnsafeBuffer underlyingbuffer,
int partitionId,
int fragmentOffset,
int fragmentLength,
Runnable onCompleteHandler)
public org.agrona.MutableDirectBuffer getBuffer()
public int getFragmentOffset()
public long nextFragment(int length,
int streamId)
length - the length of the fragmentstreamId - the stream id of the fragmentIllegalArgumentException - if the given length is greater than the remaining capacity. In
this case, you should try with smaller length, or abort the whole batch.public void commit()
public void abort()
Copyright © 2017–2018 camunda services GmbH. All rights reserved.