Skip to content

Commit 818d957

Browse files
feat(protocol): add CommandDistributionRecordValue
The CommandDistributionRecordValue contains a bunch of fields contains a single partition id, this is the partition id this specific command is getting distributed to. Apart from that it contains the command that is being distributed.
1 parent 9f0ea90 commit 818d957

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

protocol/src/main/java/io/camunda/zeebe/protocol/record/ValueTypeMapping.java

+5
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.camunda.zeebe.protocol.record;
1717

18+
import io.camunda.zeebe.protocol.record.intent.CommandDistributionIntent;
1819
import io.camunda.zeebe.protocol.record.intent.DecisionEvaluationIntent;
1920
import io.camunda.zeebe.protocol.record.intent.DecisionIntent;
2021
import io.camunda.zeebe.protocol.record.intent.DecisionRequirementsIntent;
@@ -43,6 +44,7 @@
4344
import io.camunda.zeebe.protocol.record.intent.VariableDocumentIntent;
4445
import io.camunda.zeebe.protocol.record.intent.VariableIntent;
4546
import io.camunda.zeebe.protocol.record.intent.management.CheckpointIntent;
47+
import io.camunda.zeebe.protocol.record.value.CommandDistributionRecordValue;
4648
import io.camunda.zeebe.protocol.record.value.DecisionEvaluationRecordValue;
4749
import io.camunda.zeebe.protocol.record.value.DeploymentDistributionRecordValue;
4850
import io.camunda.zeebe.protocol.record.value.DeploymentRecordValue;
@@ -189,6 +191,9 @@ public static Set<ValueType> getAcceptedValueTypes() {
189191
mapping.put(
190192
ValueType.RESOURCE_DELETION,
191193
new Mapping<>(ResourceDeletionRecordValue.class, ResourceDeletionIntent.class));
194+
mapping.put(
195+
ValueType.COMMAND_DISTRIBUTION,
196+
new Mapping<>(CommandDistributionRecordValue.class, CommandDistributionIntent.class));
192197

193198
return mapping;
194199
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Copyright © 2017 camunda services GmbH ([email protected])
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package io.camunda.zeebe.protocol.record.value;
17+
18+
import io.camunda.zeebe.protocol.record.ImmutableProtocol;
19+
import io.camunda.zeebe.protocol.record.RecordValue;
20+
import io.camunda.zeebe.protocol.record.ValueType;
21+
import org.immutables.value.Value;
22+
23+
@Value.Immutable
24+
@ImmutableProtocol(builder = ImmutableCommandDistributionRecordValue.Builder.class)
25+
public interface CommandDistributionRecordValue extends RecordValue {
26+
27+
/**
28+
* @return the partition where the record should be distributed to
29+
*/
30+
int getPartitionId();
31+
32+
/**
33+
* @return the wrapped record value type
34+
*/
35+
ValueType getValueType();
36+
37+
/**
38+
* @return the wrapped record value
39+
*/
40+
RecordValue getCommandValue();
41+
}

0 commit comments

Comments
 (0)