Class WindowBuilder
java.lang.Object
com.fluxtion.ext.streaming.builder.factory.WindowBuilder
public class WindowBuilder
extends java.lang.Object
- Author:
- Greg Higgins [email protected]
-
Constructor Summary
Constructors Constructor Description WindowBuilder()
-
Method Summary
Modifier and Type Method Description static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>>
com.fluxtion.ext.streaming.api.WrappedList<S>sliding(java.lang.Class<S> sourceClass, int itemsPerBucket, int numberOfBuckets)
static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<R>sliding(java.lang.Class<S> sourceClass, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, int itemsPerBucket, int numberOfBuckets)
static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<R>sliding(java.lang.Class<S> sourceClass, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, Duration time, int numberOfBuckets)
static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>>
com.fluxtion.ext.streaming.api.WrappedList<S>sliding(java.lang.Class<S> sourceClass, Duration time, int numberOfBuckets)
static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>>
com.fluxtion.ext.streaming.api.WrappedList<S>sliding(T source, int itemsPerBucket, int numberOfBuckets)
Creates an aggregated collection of data points as a WrappedList.static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<R>sliding(T source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, int itemsPerBucket, int numberOfBuckets)
Creates a count based sliding window aggregating data using the supplied mapping function.static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<R>sliding(T source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, Duration time, int numberOfBuckets)
Creates a time based sliding window aggregating data using the supplied mapping function.static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>>
com.fluxtion.ext.streaming.api.WrappedList<S>sliding(T source, Duration time, int numberOfBuckets)
Creates an aggregated collection of data points as a WrappedList.static <S extends com.fluxtion.ext.streaming.api.WrappedCollection>
com.fluxtion.ext.streaming.api.Wrapper<S>tumble(S source, int count)
static <S extends com.fluxtion.ext.streaming.api.WrappedCollection>
com.fluxtion.ext.streaming.api.Wrapper<S>tumble(S source, Duration time)
static <S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<S>tumble(T source, int count)
static <S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>>
com.fluxtion.ext.streaming.api.Wrapper<S>tumble(T source, Duration time)
-
Constructor Details
-
WindowBuilder
public WindowBuilder()
-
-
Method Details
-
sliding
public static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<R> sliding(T source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, int itemsPerBucket, int numberOfBuckets)Creates a count based sliding window aggregating data using the supplied mapping function. The user specifies the number of counts in a bucket and the total number of buckets. The data is published at the bucket intervals.- Type Parameters:
R
- The output type of the mapping functionS
- The input type of the mapping functionT
- The wrapper type of the source data- Parameters:
source
- The source instance for the windowmapper
- Mapping functionitemsPerBucket
- Number of elements in a bucket, also the publish rate of the aggregated datanumberOfBuckets
- The total number of buckets to be aggregated- Returns:
- The combination of all bucket values that are within scope
-
sliding
public static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<R> sliding(java.lang.Class<S> sourceClass, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, int itemsPerBucket, int numberOfBuckets) -
sliding
public static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<R> sliding(T source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, Duration time, int numberOfBuckets)Creates a time based sliding window aggregating data using the supplied mapping function. The user specifies the time in a bucket and the total number of buckets. The data is published at the bucket intervals.- Type Parameters:
R
- The output type of the mapping functionS
- The input type of the mapping functionT
- The wrapper type of the source data- Parameters:
source
- The source instance for the windowmapper
- Mapping functiontime
- Duration of each bucketnumberOfBuckets
- The total number of buckets to be aggregated- Returns:
- The combination of all bucket values that are within scope
-
sliding
public static <R, S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<R> sliding(java.lang.Class<S> sourceClass, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,R> mapper, Duration time, int numberOfBuckets) -
sliding
public static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>> com.fluxtion.ext.streaming.api.WrappedList<S> sliding(T source, int itemsPerBucket, int numberOfBuckets)Creates an aggregated collection of data points as a WrappedList. The user specifies the number of counts in a bucket and the total number of buckets. The WrappedList is published at the bucket intervals.- Type Parameters:
S
- The type of each data pointT
- The type of collection to be aggregated- Parameters:
source
- The source collectionitemsPerBucket
- Number of elements in a bucket, also the publish rate of the aggregated datanumberOfBuckets
- The total number of buckets to be aggregated- Returns:
- A WrappedList containing the union of all buckets within scope
-
sliding
public static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>> com.fluxtion.ext.streaming.api.WrappedList<S> sliding(java.lang.Class<S> sourceClass, int itemsPerBucket, int numberOfBuckets) -
sliding
public static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>> com.fluxtion.ext.streaming.api.WrappedList<S> sliding(T source, Duration time, int numberOfBuckets)Creates an aggregated collection of data points as a WrappedList. The user specifies the time duration of a bucket and the total number of buckets. The WrappedList is published at the bucket intervals.- Type Parameters:
S
- The type of each data pointT
- The type of collection to be aggregated- Parameters:
source
- The source collectiontime
- Duration of a bucketnumberOfBuckets
- The total number of buckets to be aggregated- Returns:
- A WrappedList containg the union of all buckets within scope
-
sliding
public static <S, T extends com.fluxtion.ext.streaming.api.WrappedCollection<S, ?, ?>> com.fluxtion.ext.streaming.api.WrappedList<S> sliding(java.lang.Class<S> sourceClass, Duration time, int numberOfBuckets) -
tumble
public static <S extends com.fluxtion.ext.streaming.api.WrappedCollection> com.fluxtion.ext.streaming.api.Wrapper<S> tumble(S source, int count) -
tumble
public static <S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<S> tumble(T source, int count) -
tumble
public static <S, T extends com.fluxtion.ext.streaming.api.group.GroupBy<S>> com.fluxtion.ext.streaming.api.Wrapper<T> tumble(T source, int count) -
tumble
public static <S extends com.fluxtion.ext.streaming.api.WrappedCollection> com.fluxtion.ext.streaming.api.Wrapper<S> tumble(S source, Duration time) -
tumble
public static <S, T extends com.fluxtion.ext.streaming.api.Wrapper<S>> com.fluxtion.ext.streaming.api.Wrapper<S> tumble(T source, Duration time) -
tumble
public static <S, T extends com.fluxtion.ext.streaming.api.group.GroupBy<S>> com.fluxtion.ext.streaming.api.Wrapper<T> tumble(T source, Duration time)
-