-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reducer for stream aggregation without fault tolerance (#208)
Signed-off-by: ashwinidulams <ashttk@gmail.com> Signed-off-by: yhl01 <Yashash_HL@intuit.com> Signed-off-by: Vigith Maurice <vigith@gmail.com> Signed-off-by: Yashash H L <yhl01@Yashashs-MacBook-Pro.local> Signed-off-by: Yashash H L <yashash_hl@intuit.com> Co-authored-by: yhl01 <Yashash_HL@intuit.com> Co-authored-by: Vigith Maurice <vigith@gmail.com> Co-authored-by: Yashash H L <yhl01@Yashashs-MacBook-Pro.local>
- Loading branch information
Showing
46 changed files
with
2,324 additions
and
162 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,43 @@ | ||
package messages | ||
|
||
import ( | ||
"encoding" | ||
"github.com/numaproj/numaflow/pkg/isb" | ||
"github.com/numaproj/numaflow/pkg/watermark/processor" | ||
"time" | ||
) | ||
|
||
// Message is the representation of a message flowing through the numaflow | ||
type Message interface { | ||
ReadMessage | ||
encoding.BinaryMarshaler | ||
encoding.BinaryUnmarshaler | ||
// SetID sets the ID for a message | ||
SetID(id string) | ||
// ID is the unique identifier for a message | ||
ID() string | ||
// SetEventTime represents the timestamp of the message depending on the time characteristics of the pipeline. | ||
// please note that EventTime does not mean only the event time. | ||
// This is intended to be set once and should be immutable. Therefore, an error could be thrown if | ||
// an attempt is made to overwrite the time on a message. | ||
SetEventTime(t time.Time) | ||
// EventTime returns the timestamp of the message. Calling Time() on a message should give a meaningful error | ||
// for the user to understand that a time has not been set yet. | ||
EventTime() time.Time | ||
// Key returns the key of the message | ||
Key() string | ||
// Payload returns the payload received from the source it was read. | ||
Payload() []byte | ||
} | ||
|
||
// ReadMessage exposes functions to set and get in-vertex stream characteristics of a NumaMessage. | ||
type ReadMessage interface { | ||
// Offset returns the offset of the message from the source it was read. | ||
Offset() isb.Offset | ||
// SetWatermark sets the watermark on a message read from a source. | ||
SetWatermark(watermark processor.Watermark) | ||
// Watermark returns the watermark for a message. | ||
Watermark() processor.Watermark | ||
// Ack acknowledges a message | ||
Ack() | ||
} |
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,17 @@ | ||
package partition | ||
|
||
import ( | ||
"fmt" | ||
"time" | ||
) | ||
|
||
// ID uniquely identifies a partition | ||
type ID struct { | ||
Start time.Time | ||
End time.Time | ||
Key string | ||
} | ||
|
||
func (p ID) String() string { | ||
return fmt.Sprintf("%v-%v-%s", p.Start.Unix(), p.End.Unix(), p.Key) | ||
} |
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
Oops, something went wrong.