Skip to content

Commit

Permalink
Merge pull request #45 from dolittle/add-projection-key-to-states
Browse files Browse the repository at this point in the history
Add projection key while getting states + a little cleanup
  • Loading branch information
woksin authored Apr 7, 2021
2 parents 8f11c80 + 2b5b27b commit 1a1531a
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Source/Fundamentals/Execution/ExecutionContext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ message ExecutionContext {
protobuf.Uuid correlationId = 4;
repeated security.Claim claims = 5;
string environment = 6;
}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Protobuf/Failure.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ option go_package = "go.dolittle.io/contracts/protobuf";
message Failure {
Uuid id = 1;
string reason = 2;
}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Protobuf/Uuid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ option go_package = "go.dolittle.io/contracts/protobuf";

message Uuid {
bytes value = 1;
}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Security/Claim.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ message Claim {
string key = 1;
string value = 2;
string valueType = 3;
}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Services/CallContext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ option go_package = "go.dolittle.io/contracts/services";
message CallRequestContext {
execution.ExecutionContext executionContext = 1;
protobuf.Uuid headId = 2;
}
}
4 changes: 1 addition & 3 deletions Source/Fundamentals/Services/Ping.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ option csharp_namespace = "Dolittle.Services.Contracts";
option go_package = "go.dolittle.io/contracts/services";

message Ping {

}

message Pong {

}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Services/ReverseCallContext.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ message ReverseCallRequestContext {

message ReverseCallResponseContext {
protobuf.Uuid callId = 1;
}
}
2 changes: 1 addition & 1 deletion Source/Fundamentals/Versioning/Version.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ message Version {
int32 patch = 3;
int32 build = 4;
string preReleaseString = 5;
}
}
3 changes: 2 additions & 1 deletion Source/Runtime/EventHorizon/Consumer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ message EventHorizonProducerToConsumerMessage {
services.Ping ping = 3;
}
}

service Consumer {
rpc Subscribe(stream EventHorizonConsumerToProducerMessage) returns(stream EventHorizonProducerToConsumerMessage);
}
}
2 changes: 1 addition & 1 deletion Source/Runtime/EventHorizon/Subscriptions.proto
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ message Subscription {

service Subscriptions {
rpc Subscribe(Subscription) returns(SubscriptionResponse);
}
}
2 changes: 1 addition & 1 deletion Source/Runtime/Events.Processing/Filters.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ service Filters {
rpc Connect(stream FilterClientToRuntimeMessage) returns(stream FilterRuntimeToClientMessage);
rpc ConnectPartitioned(stream PartitionedFilterClientToRuntimeMessage) returns (stream FilterRuntimeToClientMessage);
rpc ConnectPublic(stream PublicFilterClientToRuntimeMessage) returns (stream FilterRuntimeToClientMessage);
}
}
18 changes: 4 additions & 14 deletions Source/Runtime/Events.Processing/Projections.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import "Fundamentals/Services/ReverseCallContext.proto";
import "Fundamentals/Services/Ping.proto";
import "Runtime/Events.Processing/StreamEvent.proto";
import "Runtime/Events.Processing/Processors.proto";
import "Runtime/Projections/State.proto";

package dolittle.runtime.events.processing;

Expand Down Expand Up @@ -68,22 +69,11 @@ message ProjectionRegistrationResponse {
protobuf.Failure failure = 1;
}

enum ProjectionCurrentStateType {
CREATED_FROM_INITIAL_STATE = 0;
PERSISTED = 1;
}

message ProjectionCurrentState {
ProjectionCurrentStateType type = 1;
string state = 2;
}

message ProjectionRequest {
services.ReverseCallRequestContext callContext = 1;
string key = 2;
ProjectionCurrentState currentState = 3;
StreamEvent event = 4;
RetryProcessingState retryProcessingState = 5;
projections.ProjectionCurrentState currentState = 2;
StreamEvent event = 3;
RetryProcessingState retryProcessingState = 4;
}

message ProjectionRuntimeToClientMessage {
Expand Down
2 changes: 1 addition & 1 deletion Source/Runtime/Events/Aggregate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ option go_package = "go.dolittle.io/contracts/runtime/events";
message Aggregate {
protobuf.Uuid eventSourceId = 1;
protobuf.Uuid aggregateRootId = 2;
}
}
20 changes: 20 additions & 0 deletions Source/Runtime/Projections/State.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright (c) Dolittle. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

syntax = "proto3";

package dolittle.runtime.projections;

option csharp_namespace = "Dolittle.Runtime.Projections.Contracts";
option go_package = "go.dolittle.io/contracts/runtime/projections";

enum ProjectionCurrentStateType {
CREATED_FROM_INITIAL_STATE = 0;
PERSISTED = 1;
}

message ProjectionCurrentState {
ProjectionCurrentStateType type = 1;
string key = 2;
string state = 3;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ syntax = "proto3";
import "Fundamentals/Protobuf/Failure.proto";
import "Fundamentals/Protobuf/Uuid.proto";
import "Fundamentals/Services/CallContext.proto";
import "Runtime/Events.Processing/Projections.proto";
import "Runtime/Projections/State.proto";

package dolittle.runtime.projections;

Expand All @@ -27,13 +27,13 @@ message GetAllRequest {
}

message GetOneResponse {
protobuf.Failure failure = 1; // not set if not failed
events.processing.ProjectionCurrentState state = 2;
ProjectionCurrentState state = 1;
protobuf.Failure failure = 2; // not set if not failed
}

message GetAllResponse {
protobuf.Failure failure = 1; // not set if not failed
repeated events.processing.ProjectionCurrentState states = 2;
repeated ProjectionCurrentState states = 1;
protobuf.Failure failure = 2; // not set if not failed
}


Expand Down

0 comments on commit 1a1531a

Please sign in to comment.