Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement batch map #132

Merged
merged 7 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 50 additions & 23 deletions pkg/apis/proto/map/v1/map.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/apis/proto/map/v1/map.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ service Map {

// IsReady is the heartbeat endpoint for gRPC.
rpc IsReady(google.protobuf.Empty) returns (ReadyResponse);

// MapStreamFn is a bi-directional streaming rpc which applies a
// Map function on each element of the stream and then returns streams
// back MapResponse elements.
// TODO(map-batch): in the target state when we move the current
// unary implementation to bi-di as well, we can rename this and
// use a single rpc for both.
rpc MapStreamFn(stream MapRequest) returns (stream MapResponse);
}

/**
Expand All @@ -24,18 +32,25 @@ message MapRequest {
google.protobuf.Timestamp event_time = 3;
google.protobuf.Timestamp watermark = 4;
map<string, string> headers = 5;
string id = 6;
}

/**
* MapResponse represents a response element.
*/
// TODO(map-batch) - currently this is used by both batch map and unary map.
// Do we want to have a separate response struct for batch map responses
// which have only one element instead of a list of responses.
// In that case we need a different mechanism to indicate that all the responses for a given request
// have been completed.
message MapResponse {
message Result {
repeated string keys = 1;
bytes value = 2;
repeated string tags = 3;
}
repeated Result results = 1;
string id = 2;
}

/**
Expand Down
85 changes: 83 additions & 2 deletions pkg/apis/proto/map/v1/map_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading