-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into protof
Signed-off-by: Derek Wang <[email protected]>
- Loading branch information
Showing
125 changed files
with
4,357 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
syntax = "proto3"; | ||
|
||
option go_package = "github.com/numaproj/numaflow-go/pkg/apis/proto/reduce/v1"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
|
||
package reduce.v1; | ||
|
||
service Reduce { | ||
// ReduceFn applies a reduce function to a request stream. | ||
rpc ReduceFn(stream ReduceRequest) returns (stream ReduceResponse); | ||
|
||
// IsReady is the heartbeat endpoint for gRPC. | ||
rpc IsReady(google.protobuf.Empty) returns (ReadyResponse); | ||
} | ||
|
||
/** | ||
* ReduceRequest represents a request element. | ||
*/ | ||
message ReduceRequest { | ||
// WindowOperation represents a window operation. | ||
// For Aligned windows, OPEN, APPEND and CLOSE events are sent. | ||
message WindowOperation { | ||
enum Event { | ||
OPEN = 0; | ||
CLOSE = 1; | ||
APPEND = 4; | ||
} | ||
|
||
Event event = 1; | ||
repeated Window windows = 2; | ||
} | ||
|
||
// Payload represents a payload element. | ||
message Payload { | ||
repeated string keys = 1; | ||
bytes value = 2; | ||
google.protobuf.Timestamp event_time = 3; | ||
google.protobuf.Timestamp watermark = 4; | ||
} | ||
|
||
Payload payload = 1; | ||
WindowOperation operation = 2; | ||
} | ||
|
||
// Window represents a window. | ||
// Since the client doesn't track keys, window doesn't have a keys field. | ||
message Window { | ||
google.protobuf.Timestamp start = 1; | ||
google.protobuf.Timestamp end = 2; | ||
string slot = 3; | ||
} | ||
|
||
/** | ||
* ReduceResponse represents a response element. | ||
*/ | ||
message ReduceResponse { | ||
// Result represents a result element. It contains the result of the reduce function. | ||
message Result { | ||
repeated string keys = 1; | ||
bytes value = 2; | ||
repeated string tags = 3; | ||
} | ||
|
||
Result result = 1; | ||
|
||
// window represents a window to which the result belongs. | ||
Window window = 2; | ||
|
||
// EOF represents the end of the response for a window. | ||
bool EOF = 3; | ||
} | ||
|
||
/** | ||
* ReadyResponse is the health check result. | ||
*/ | ||
message ReadyResponse { | ||
bool ready = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package v1 | ||
|
||
//go:generate mockgen -destination sessionreducemock/sessionreducemock.go -package sessionreducemock github.com/numaproj/numaflow-go/pkg/apis/proto/sessionreduce/v1 SessionReduceClient,SessionReduce_SessionReduceFnClient |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
syntax = "proto3"; | ||
|
||
option go_package = "github.com/numaproj/numaflow-go/pkg/apis/proto/reducestream/v1"; | ||
|
||
import "google/protobuf/empty.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
|
||
package sessionreduce.v1; | ||
|
||
service SessionReduce { | ||
// SessionReduceFn applies a reduce function to a request stream. | ||
rpc SessionReduceFn(stream SessionReduceRequest) returns (stream SessionReduceResponse); | ||
|
||
// IsReady is the heartbeat endpoint for gRPC. | ||
rpc IsReady(google.protobuf.Empty) returns (ReadyResponse); | ||
} | ||
|
||
// KeyedWindow represents a window with keys. | ||
// since the client track the keys, we use keyed window. | ||
message KeyedWindow { | ||
google.protobuf.Timestamp start = 1; | ||
google.protobuf.Timestamp end = 2; | ||
string slot = 3; | ||
repeated string keys = 4; | ||
} | ||
|
||
/** | ||
* SessionReduceRequest represents a request element. | ||
*/ | ||
message SessionReduceRequest { | ||
// WindowOperation represents a window operation. | ||
// For Aligned window values can be one of OPEN, CLOSE, EXPAND, MERGE and APPEND. | ||
message WindowOperation { | ||
enum Event { | ||
OPEN = 0; | ||
CLOSE = 1; | ||
EXPAND = 2; | ||
MERGE = 3; | ||
APPEND = 4; | ||
} | ||
|
||
Event event = 1; | ||
repeated KeyedWindow keyedWindows = 2; | ||
} | ||
|
||
// Payload represents a payload element. | ||
message Payload { | ||
repeated string keys = 1; | ||
bytes value = 2; | ||
google.protobuf.Timestamp event_time = 3; | ||
google.protobuf.Timestamp watermark = 4; | ||
} | ||
|
||
Payload payload = 1; | ||
WindowOperation operation = 2; | ||
} | ||
|
||
/** | ||
* SessionReduceResponse represents a response element. | ||
*/ | ||
message SessionReduceResponse { | ||
// Result represents a result element. It contains the result of the reduce function. | ||
message Result { | ||
repeated string keys = 1; | ||
bytes value = 2; | ||
repeated string tags = 3; | ||
} | ||
|
||
Result result = 1; | ||
|
||
// keyedWindow represents a window to which the result belongs. | ||
KeyedWindow keyedWindow = 2; | ||
|
||
// EOF represents the end of the response for a window. | ||
bool EOF = 3; | ||
} | ||
|
||
/** | ||
* ReadyResponse is the health check result. | ||
*/ | ||
message ReadyResponse { | ||
bool ready = 1; | ||
} |
Oops, something went wrong.