numaproj / numaflow-go

Numaflow Golang SDK
Apache License 2.0
46 stars 11 forks source link

refactor the reduce proto #96

Open KeranYang opened 9 months ago

KeranYang commented 9 months ago

Below is the current reduce proto.

/**
 * ReduceResponse represents a response element.
 */
message ReduceResponse {
  // FIXME: put all fields(window, EOF) inside of Result. Reference: https://protobuf.dev/programming-guides/api/#dont-include-primitive-types
  // 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.
  // When it's set to true, the platform considers the response as an indicator which doesn't contain real data.
  bool EOF = 3;
}

We should put all fields inside of the Result message. Reasoning: https://protobuf.dev/programming-guides/api/#dont-include-primitive-types

This requires changes at multiple places.