Skip to content

Commit

Permalink
Sliding Max and Min Aggregate optimization by eliminating covered values
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkm committed Nov 25, 2019
1 parent ada8d3a commit 55d7391
Show file tree
Hide file tree
Showing 11 changed files with 498 additions and 212 deletions.
31 changes: 31 additions & 0 deletions Sources/Core/Microsoft.StreamProcessing/Aggregates/MinMaxState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,35 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License
// *********************************************************************
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace Microsoft.StreamProcessing.Internal
{
/// <summary>
/// The value representation with its timestamp.
/// </summary>
/// <typeparam name="T">The type of the underlying elements being aggregated.</typeparam>
[DataContract]
[EditorBrowsable(EditorBrowsableState.Never)]
public struct ValueAndTimestamp<T>
{
/// <summary>
/// The timestamp of the payload.
/// </summary>
[DataMember]
[EditorBrowsable(EditorBrowsableState.Never)]
public long timestamp;

/// <summary>
/// Payload of the event
/// </summary>
[DataMember]
[EditorBrowsable(EditorBrowsableState.Never)]
public T value;
}

/// <summary>
/// The state object used in minimum and maximum aggregates.
/// </summary>
Expand All @@ -22,6 +46,13 @@ public struct MinMaxState<T>
[EditorBrowsable(EditorBrowsableState.Never)]
public SortedMultiSet<T> savedValues;

/// <summary>
/// List of values and its timestamp
/// </summary>
[DataMember]
[EditorBrowsable(EditorBrowsableState.Never)]
public ElasticCircularBuffer<ValueAndTimestamp<T>> values;

/// <summary>
/// The current value if the aggregate were to be computed immediately.
/// </summary>
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 55d7391

Please sign in to comment.