Skip to content

Output when SessionTimeoutWindow() ends #139

@shreyasraghunath

Description

@shreyasraghunath

Hello,

I have been working with Trill for an Real-time application where we need to aggregate live streaming data and output when a SessionTimeoutWindow closes. Using the syntax:

var query = inputStream
            .SessionTimeoutWindow(TimeSpan.FromSeconds(30).Ticks)
            .GroupAggregate(
            x => x.DeviceGuid,
            x => x.Min(v => DateTime.Parse(v.ReceivedTime)),
            x => x.Max(v => DateTime.Parse(v.ReceivedTime)),
            (key, startTime, endTime) => new { key.Key, startTime, endTime }) 

and registering the input as:

var inputStream = this.queryContainer.RegisterInput(
                this.input,
                DisorderPolicy.Adjust(),
                FlushPolicy.FlushOnPunctuation,
                PeriodicPunctuationPolicy.Time((ulong)TimeSpan.FromSeconds(1).Ticks),
                OnCompletedPolicy.EndOfStream);

Trill is able to output whenever it receives a Punctuation and returns intermediary results whenever it receives a Punctuation. What we need instead is Trill to only return when the Session closes. I have tried various combinations to remove the dependency on Punctuations and instead register the input with other settings, but Trill doesn't output anything in that case. Is there a way I can force Trill to output the result of the query only when the SessionTimeoutWindow closes and not the intermediate states when it receives the Punctuation? Thanks for the help.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions