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: tricklenode #2530

Merged
merged 6 commits into from
Jun 2, 2021
Merged

feat: tricklenode #2530

merged 6 commits into from
Jun 2, 2021

Conversation

docmerlin
Copy link
Contributor

@docmerlin docmerlin commented Apr 13, 2021

This creates a node that converts from a batch to a stream, it could be thought of as the inverse of windownode.

@@ -8,6 +8,8 @@ import (
"testing"
"time"

"github.com/google/go-cmp/cmp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs reformatted


func (n *TrickleNode) runTrickle(_ []byte) error {
consumer := edge.NewConsumerWithReceiver(
n.ins[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we enforce anywhere that len(ins) == 1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the attachment, in the tick code.


// BatchPoint forwards a PointMessage
func (n *TrickleNode) BatchPoint(bp edge.BatchPointMessage) error {
return n.outs[0].Collect(edge.NewPointMessage(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question with len(outs)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the attachment, in the tick code. if len is not 1, we will have errors way before it gets to here.

data
|trickle()
|window().period(10s)
|httpOut('TestBatch_Trickle')`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checking my understanding: this test is showing that trickle() followed by window is a way to re-batch data? i.e. in this case, re-batching from 4s windows into 10s windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also that the results of trickle are unbached as window cannot accept batch data, but the inputs to trickle are batched.

@docmerlin docmerlin requested a review from danxmoran May 28, 2021 18:52
@docmerlin docmerlin merged commit fef0d30 into master Jun 2, 2021
@docmerlin docmerlin deleted the tricklenode branch June 2, 2021 16:29
docmerlin added a commit that referenced this pull request Jun 2, 2021
* feat: tricklenode

* chore: update changelog

* test: fix TestTrickle ast test

* chore: cleanup imports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants