Class TypedCommandWriterImpl
- java.lang.Object
-
- io.zeebe.engine.processing.streamprocessor.writers.TypedCommandWriterImpl
-
- All Implemented Interfaces:
TypedCommandWriter
- Direct Known Subclasses:
TypedStreamWriterImpl
public class TypedCommandWriterImpl extends Object implements TypedCommandWriter
-
-
Field Summary
Fields Modifier and Type Field Description protected LogStreamBatchWriterbatchWriterprotected RecordMetadatametadataprotected Consumer<RecordMetadata>noopprotected longsourceRecordPositionprotected Map<Class<? extends UnpackedObject>,ValueType>typeRegistry
-
Constructor Summary
Constructors Constructor Description TypedCommandWriterImpl(LogStreamBatchWriter batchWriter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendFollowUpCommand(long key, Intent intent, UnpackedObject value)voidappendFollowUpCommand(long key, Intent intent, UnpackedObject value, Consumer<RecordMetadata> metadata)voidappendNewCommand(Intent intent, UnpackedObject value)protected voidappendRecord(long key, RecordType type, Intent intent, UnpackedObject value, Consumer<RecordMetadata> additionalMetadata)protected voidappendRecord(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, UnpackedObject value, Consumer<RecordMetadata> additionalMetadata)voidconfigureSourceContext(long sourceRecordPosition)longflush()protected voidinitMetadata(RecordType type, Intent intent, UnpackedObject value)voidreset()
-
-
-
Field Detail
-
noop
protected final Consumer<RecordMetadata> noop
-
typeRegistry
protected final Map<Class<? extends UnpackedObject>,ValueType> typeRegistry
-
metadata
protected final RecordMetadata metadata
-
batchWriter
protected final LogStreamBatchWriter batchWriter
-
sourceRecordPosition
protected long sourceRecordPosition
-
-
Constructor Detail
-
TypedCommandWriterImpl
public TypedCommandWriterImpl(LogStreamBatchWriter batchWriter)
-
-
Method Detail
-
configureSourceContext
public void configureSourceContext(long sourceRecordPosition)
-
initMetadata
protected void initMetadata(RecordType type, Intent intent, UnpackedObject value)
-
appendRecord
protected void appendRecord(long key, RecordType type, Intent intent, UnpackedObject value, Consumer<RecordMetadata> additionalMetadata)
-
appendRecord
protected void appendRecord(long key, RecordType type, Intent intent, RejectionType rejectionType, String rejectionReason, UnpackedObject value, Consumer<RecordMetadata> additionalMetadata)
-
appendNewCommand
public void appendNewCommand(Intent intent, UnpackedObject value)
- Specified by:
appendNewCommandin interfaceTypedCommandWriter
-
appendFollowUpCommand
public void appendFollowUpCommand(long key, Intent intent, UnpackedObject value)- Specified by:
appendFollowUpCommandin interfaceTypedCommandWriter
-
appendFollowUpCommand
public void appendFollowUpCommand(long key, Intent intent, UnpackedObject value, Consumer<RecordMetadata> metadata)- Specified by:
appendFollowUpCommandin interfaceTypedCommandWriter
-
reset
public void reset()
- Specified by:
resetin interfaceTypedCommandWriter
-
flush
public long flush()
- Specified by:
flushin interfaceTypedCommandWriter- Returns:
- position of new record, negative value on failure
-
-