Class LegacyTypedStreamWriterImpl
java.lang.Object
io.camunda.zeebe.engine.processing.streamprocessor.writers.LegacyTypedStreamWriterImpl
- All Implemented Interfaces:
LegacyTypedCommandWriter,LegacyTypedStreamWriter,TypedCommandWriter,TypedEventWriter,TypedRejectionWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendFollowUpCommand(long key, Intent intent, RecordValue value) voidappendFollowUpEvent(long key, Intent intent, RecordValue value) voidappendNewCommand(Intent intent, RecordValue value) protected voidappendRecord(long key, RecordType type, Intent intent, RecordValue value) voidappendRecord(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, RecordValue value) voidappendRejection(TypedRecord<? extends RecordValue> command, RejectionType rejectionType, String reason) booleancanWriteEventOfLength(int eventLength) Use this to know whether you can add an event of the given length to the underlying batch writer.voidconfigureSourceContext(long sourceRecordPosition) longflush()intThis is not actually accurate, as the frame length needs to also be aligned by the same amount of bytes as the batch.protected voidinitMetadata(RecordType type, Intent intent, RecordValue value) voidreset()
-
Constructor Details
-
LegacyTypedStreamWriterImpl
-
-
Method Details
-
initMetadata
-
appendRecord
-
appendRecord
public void appendRecord(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, RecordValue value) - Specified by:
appendRecordin interfaceLegacyTypedStreamWriter
-
configureSourceContext
public void configureSourceContext(long sourceRecordPosition) - Specified by:
configureSourceContextin interfaceLegacyTypedStreamWriter
-
appendNewCommand
- Specified by:
appendNewCommandin interfaceLegacyTypedCommandWriter- Specified by:
appendNewCommandin interfaceTypedCommandWriter
-
appendFollowUpCommand
- Specified by:
appendFollowUpCommandin interfaceLegacyTypedCommandWriter- Specified by:
appendFollowUpCommandin interfaceTypedCommandWriter
-
reset
public void reset()- Specified by:
resetin interfaceLegacyTypedCommandWriter
-
flush
public long flush()- Specified by:
flushin interfaceLegacyTypedCommandWriter- Returns:
- position of new record, negative value on failure
-
appendRejection
public void appendRejection(TypedRecord<? extends RecordValue> command, RejectionType rejectionType, String reason) - Specified by:
appendRejectionin interfaceTypedRejectionWriter
-
appendFollowUpEvent
- Specified by:
appendFollowUpEventin 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:
canWriteEventOfLengthin interfaceTypedEventWriter- Parameters:
eventLength- the length of the event that will be added to the batch- Returns:
- true if an event of length
eventLengthcan 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:
getMaxEventLengthin interfaceTypedEventWriter- Returns:
- an approximate value of the max fragment length
-