Skip to content

Commit

Permalink
Merge pull request #592 from camunda/bump_zeebe
Browse files Browse the repository at this point in the history
feat(deps): change Zeebe version to 8.2.0-alpha2
  • Loading branch information
remcowesterhoud authored Dec 6, 2022
2 parents 082acb5 + d176f8d commit 61c2363
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@

package io.camunda.zeebe.process.test.engine;

import io.camunda.zeebe.logstreams.log.LogAppendEntry;
import io.camunda.zeebe.logstreams.log.LogStreamWriter;
import io.camunda.zeebe.logstreams.log.LogStreamRecordWriter;
import io.camunda.zeebe.protocol.impl.record.RecordMetadata;
import io.camunda.zeebe.util.buffer.BufferWriter;

/**
* This record is responsible for writing the commands to the {@link LogStreamWriter} in a
* This record is responsible for writing the commands to the {@link LogStreamRecordWriter} in a
* thread-safe way.
*/
record CommandWriter(LogStreamWriter writer) {
record CommandWriter(LogStreamRecordWriter writer) {

void writeCommandWithKey(
final Long key, final BufferWriter bufferWriter, final RecordMetadata recordMetadata) {
synchronized (writer) {
writer.tryWrite(LogAppendEntry.of(key, recordMetadata, bufferWriter));
writer.reset();
writer.key(key).metadataWriter(recordMetadata).valueWriter(bufferWriter).tryWrite();
}
}

void writeCommandWithoutKey(
final BufferWriter bufferWriter, final RecordMetadata recordMetadata) {
synchronized (writer) {
writer.tryWrite(LogAppendEntry.of(recordMetadata, bufferWriter));
writer.reset();
writer.keyNull().metadataWriter(recordMetadata).valueWriter(bufferWriter).tryWrite();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public static ZeebeTestEngine create(final int port) {
final InMemoryLogStorage logStorage = new InMemoryLogStorage();
final LogStream logStream = createLogStream(logStorage, scheduler, partitionId);

final CommandWriter commandWriter = new CommandWriter(logStream.newLogStreamWriter().join());
final CommandWriter commandWriter =
new CommandWriter(logStream.newLogStreamRecordWriter().join());
final CommandSender commandSender = new CommandSender(commandWriter);
final GatewayRequestStore gatewayRequestStore = new GatewayRequestStore();
final GrpcToLogStreamGateway gateway =
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<dependency.slf4j.version>2.0.5</dependency.slf4j.version>
<dependency.snakeyaml.version>1.33</dependency.snakeyaml.version>
<dependency.testcontainers.version>1.17.6</dependency.testcontainers.version>
<dependency.zeebe.version>8.2.0-SNAPSHOT</dependency.zeebe.version>
<dependency.zeebe.version>8.2.0-alpha2</dependency.zeebe.version>

<license.header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</license.header>

Expand Down

0 comments on commit 61c2363

Please sign in to comment.