Interface StreamOperator
public interface StreamOperator
An interface defining stream operations on a node in a SEP graph. The
ServiceLoader
mechanism is used to load an implementation at runtime
for the StreamOperator interface.- Author:
- V12 Technology Ltd.
-
Method Summary
Modifier and Type Method Description default <T, I extends java.lang.Integer>
java.util.Comparator<T>comparing(com.fluxtion.api.partition.LambdaReflection.SerializableBiFunction<T,T,I> func)
default <T> Wrapper<T>
defaultVal(Wrapper<T> source, T defaultValue)
default <T> FilterWrapper<T>
filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends T,java.lang.Boolean> filter, Wrapper<T> source, boolean cast)
default <S, T> FilterWrapper<T>
filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,java.lang.Boolean> filter, Wrapper<T> source, java.lang.reflect.Method accessor, boolean cast)
default <T, S extends T>
Wrapper<T>forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<S> consumer, Wrapper<T> source, java.lang.String consumerId)
Supply the wrapper to a consumer when the wrapper is on the execution pathdefault <T, R> Wrapper<R>
get(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper, Wrapper<T> source)
Streams the return of a method as a wrapped instance.default <K, T, S extends java.lang.Number, F extends NumericFunctionStateless, R extends java.lang.Number>
GroupBy<R>group(Wrapper<T> source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,K> key, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier, java.lang.Class<F> functionClass)
default <T, S extends java.lang.Number, F extends NumericFunctionStateless, R extends java.lang.Number>
GroupBy<R>group(Wrapper<T> source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> key, java.lang.Class<F> functionClass)
default <T> Wrapper<T>
log(Wrapper<T> source, java.lang.String message, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,?>... supplier)
default <T, R> WrapperBase<T,?>
log(WrapperBase<T,?> source, java.lang.String message, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,?>... supplier)
default <R, S, U> Wrapper<R>
map(com.fluxtion.api.partition.LambdaReflection.SerializableBiFunction<? extends U,? extends S,R> mapper, Argument<? extends U> arg1, Argument<? extends S> arg2)
default <T, R> Wrapper<R>
map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper, Wrapper<T> source, boolean cast)
default <T, R> Wrapper<R>
map(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper, Wrapper<T> source, java.lang.reflect.Method accessor, boolean cast)
default <F, R> Wrapper<R>
map(F mapper, java.lang.reflect.Method mappingMethod, Argument... args)
default <T> T
nodeId(T node, java.lang.String name)
name a StreamOperator node in the generated SEP.default <T> Wrapper<T>
notiferMerge(Wrapper<T> source, java.lang.Object notifier)
Attaches an event notification instance to the current stream node and merges notifications from stream and the added notifier.When the notifier updates all the child nodes of this stream node will be on the execution path and invoked following normal SEP rules.The existing execution path will be unaltered if either the parent wrapped node or the eventNotifier updates then the execution path will progress.default <T> Wrapper<T>
notifierOverride(Wrapper<T> source, java.lang.Object notifier)
Attaches an event notification instance to the current stream node, overriding the execution path of the current stream.Only when the notifier updates will the child nodes of this stream node be on the execution path.default <T, R> void
push(Wrapper<T> source, java.lang.reflect.Method accessor, com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<R> consumer)
push data from the wrapper to the consumerdefault <T> Wrapper<T>
select(java.lang.Class<T> eventClazz)
static StreamOperator
service()
default <S> Wrapper<S>
streamInstance(com.fluxtion.api.partition.LambdaReflection.SerializableSupplier<S> source)
-
Method Details
-
select
-
filter
default <S, T> FilterWrapper<T> filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<S,java.lang.Boolean> filter, Wrapper<T> source, java.lang.reflect.Method accessor, boolean cast) -
filter
default <T> FilterWrapper<T> filter(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<? extends T,java.lang.Boolean> filter, Wrapper<T> source, boolean cast) -
group
default <T, S extends java.lang.Number, F extends NumericFunctionStateless, R extends java.lang.Number> GroupBy<R> group(Wrapper<T> source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> key, java.lang.Class<F> functionClass) -
group
default <K, T, S extends java.lang.Number, F extends NumericFunctionStateless, R extends java.lang.Number> GroupBy<R> group(Wrapper<T> source, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,K> key, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,S> supplier, java.lang.Class<F> functionClass) -
streamInstance
default <S> Wrapper<S> streamInstance(com.fluxtion.api.partition.LambdaReflection.SerializableSupplier<S> source) -
get
default <T, R> Wrapper<R> get(com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,R> mapper, Wrapper<T> source)Streams the return of a method as a wrapped instance.- Type Parameters:
T
-R
-- Parameters:
mapper
-source
-- Returns:
-
map
-
map
-
map
-
map
-
push
default <T, R> void push(Wrapper<T> source, java.lang.reflect.Method accessor, com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<R> consumer)push data from the wrapper to the consumer- Type Parameters:
T
-R
-- Parameters:
source
-accessor
-consumer
-
-
forEach
default <T, S extends T> Wrapper<T> forEach(com.fluxtion.api.partition.LambdaReflection.SerializableConsumer<S> consumer, Wrapper<T> source, java.lang.String consumerId)Supply the wrapper to a consumer when the wrapper is on the execution path- Type Parameters:
T
-S
-- Parameters:
consumer
-source
-consumerId
- - id for node in SEP, can be null for autonaming- Returns:
-
log
-
log
default <T, R> WrapperBase<T,?> log(WrapperBase<T,?> source, java.lang.String message, com.fluxtion.api.partition.LambdaReflection.SerializableFunction<T,?>... supplier) -
notiferMerge
Attaches an event notification instance to the current stream node and merges notifications from stream and the added notifier.When the notifier updates all the child nodes of this stream node will be on the execution path and invoked following normal SEP rules.The existing execution path will be unaltered if either the parent wrapped node or the eventNotifier updates then the execution path will progress.- Type Parameters:
T
-- Parameters:
source
-notifier
-- Returns:
-
notifierOverride
Attaches an event notification instance to the current stream node, overriding the execution path of the current stream.Only when the notifier updates will the child nodes of this stream node be on the execution path.- Type Parameters:
T
-- Parameters:
source
-notifier
- external event notifier- Returns:
-
nodeId
default <T> T nodeId(T node, java.lang.String name)name a StreamOperator node in the generated SEP.- Type Parameters:
T
-- Parameters:
node
-name
-- Returns:
-
comparing
default <T, I extends java.lang.Integer> java.util.Comparator<T> comparing(com.fluxtion.api.partition.LambdaReflection.SerializableBiFunction<T,T,I> func) -
defaultVal
-
service
-