Class TypedStreamWriterImpl
java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.writers.TypedStreamWriterImpl
- All Implemented Interfaces:
TypedCommandWriter
,TypedEventWriter
,TypedRejectionWriter
,TypedStreamWriter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendFollowUpCommand
(long key, Intent intent, RecordValue value) void
appendFollowUpEvent
(long key, Intent intent, RecordValue value) void
appendNewCommand
(Intent intent, RecordValue value) protected void
appendRecord
(long key, RecordType type, Intent intent, RecordValue value) protected void
appendRecord
(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, RecordValue value) void
appendRejection
(TypedRecord<? extends RecordValue> command, RejectionType rejectionType, String reason) boolean
canWriteEventOfLength
(int eventLength) Use this to know whether you can add an event of the given length to the underlying batch writer.void
configureSourceContext
(long sourceRecordPosition) long
flush()
int
This is not actually accurate, as the frame length needs to also be aligned by the same amount of bytes as the batch.protected void
initMetadata
(RecordType type, Intent intent, RecordValue value) void
reset()
-
Constructor Details
-
TypedStreamWriterImpl
-
-
Method Details
-
initMetadata
-
appendRecord
-
appendRecord
protected void appendRecord(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, RecordValue value) -
appendNewCommand
- Specified by:
appendNewCommand
in interfaceTypedCommandWriter
-
appendFollowUpCommand
- Specified by:
appendFollowUpCommand
in interfaceTypedCommandWriter
-
reset
public void reset()- Specified by:
reset
in interfaceTypedCommandWriter
-
flush
public long flush()- Specified by:
flush
in interfaceTypedCommandWriter
- Returns:
- position of new record, negative value on failure
-
appendRejection
public void appendRejection(TypedRecord<? extends RecordValue> command, RejectionType rejectionType, String reason) - Specified by:
appendRejection
in interfaceTypedRejectionWriter
-
configureSourceContext
public void configureSourceContext(long sourceRecordPosition) - Specified by:
configureSourceContext
in interfaceTypedStreamWriter
-
appendFollowUpEvent
- Specified by:
appendFollowUpEvent
in interfaceTypedEventWriter
-
canWriteEventOfLength
public boolean canWriteEventOfLength(int eventLength) Use this to know whether you can add an event of the given length to the underlying batch writer.- Specified by:
canWriteEventOfLength
in interfaceTypedEventWriter
- Parameters:
eventLength
- the length of the event that will be added to the batch- Returns:
- true if an event of length
eventLength
can be added to this batch such that it can later be written
-
getMaxEventLength
public int getMaxEventLength()This is not actually accurate, as the frame length needs to also be aligned by the same amount of bytes as the batch. However, this would break concerns here, i.e. the writer here would have to become Dispatcher aware.- Specified by:
getMaxEventLength
in interfaceTypedEventWriter
- Returns:
- an approximate value of the max fragment length
-