T
- Type of the eventspublic class PatternStream<T> extends Object
NFA
. In order to process the detected sequences, the user has to
specify a PatternSelectFunction
or a PatternFlatSelectFunction
.
Additionally it allows to handle partially matched event patterns which have timed out. For
this the user has to specify a PatternTimeoutFunction
or a PatternFlatTimeoutFunction
.
Modifier and Type | Class and Description |
---|---|
static class |
PatternStream.CoMapTimeout<R,L>
Used for joining results from timeout side-output for API backward compatibility.
|
Modifier and Type | Method and Description |
---|---|
<L,R> SingleOutputStreamOperator<R> |
flatSelect(OutputTag<L> timedOutPartialMatchesTag,
PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction,
PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
Applies a flat select function to the detected pattern sequence.
|
<L,R> SingleOutputStreamOperator<R> |
flatSelect(OutputTag<L> timedOutPartialMatchesTag,
PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction,
TypeInformation<R> outTypeInfo,
PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
Applies a flat select function to the detected pattern sequence.
|
<R> SingleOutputStreamOperator<R> |
flatSelect(PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
Applies a flat select function to the detected pattern sequence.
|
<R> SingleOutputStreamOperator<R> |
flatSelect(PatternFlatSelectFunction<T,R> patternFlatSelectFunction,
TypeInformation<R> outTypeInfo)
Applies a flat select function to the detected pattern sequence.
|
<L,R> SingleOutputStreamOperator<Either<L,R>> |
flatSelect(PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction,
PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
Deprecated.
Use
flatSelect(OutputTag, PatternFlatTimeoutFunction,
PatternFlatSelectFunction) that returns timed out events as a side-output |
PatternStream<T> |
inEventTime()
Sets the time characteristic to event time.
|
PatternStream<T> |
inProcessingTime()
Sets the time characteristic to processing time.
|
<R> SingleOutputStreamOperator<R> |
process(PatternProcessFunction<T,R> patternProcessFunction)
Applies a process function to the detected pattern sequence.
|
<R> SingleOutputStreamOperator<R> |
process(PatternProcessFunction<T,R> patternProcessFunction,
TypeInformation<R> outTypeInfo)
Applies a process function to the detected pattern sequence.
|
<L,R> SingleOutputStreamOperator<R> |
select(OutputTag<L> timedOutPartialMatchesTag,
PatternTimeoutFunction<T,L> patternTimeoutFunction,
PatternSelectFunction<T,R> patternSelectFunction)
Applies a select function to the detected pattern sequence.
|
<L,R> SingleOutputStreamOperator<R> |
select(OutputTag<L> timedOutPartialMatchesTag,
PatternTimeoutFunction<T,L> patternTimeoutFunction,
TypeInformation<R> outTypeInfo,
PatternSelectFunction<T,R> patternSelectFunction)
Applies a select function to the detected pattern sequence.
|
<R> SingleOutputStreamOperator<R> |
select(PatternSelectFunction<T,R> patternSelectFunction)
Applies a select function to the detected pattern sequence.
|
<R> SingleOutputStreamOperator<R> |
select(PatternSelectFunction<T,R> patternSelectFunction,
TypeInformation<R> outTypeInfo)
Applies a select function to the detected pattern sequence.
|
<L,R> SingleOutputStreamOperator<Either<L,R>> |
select(PatternTimeoutFunction<T,L> patternTimeoutFunction,
PatternSelectFunction<T,R> patternSelectFunction)
Deprecated.
Use
select(OutputTag, PatternTimeoutFunction,
PatternSelectFunction) that returns timed out events as a side-output |
PatternStream<T> |
sideOutputLateData(OutputTag<T> lateDataOutputTag)
Send late arriving data to the side output identified by the given
OutputTag . |
public PatternStream<T> sideOutputLateData(OutputTag<T> lateDataOutputTag)
OutputTag
. A
record is considered late after the watermark has passed its timestamp.
You can get the stream of late data using SingleOutputStreamOperator.getSideOutput(OutputTag)
on the SingleOutputStreamOperator
resulting from the pattern processing operations.
public PatternStream<T> inProcessingTime()
public PatternStream<T> inEventTime()
public <R> SingleOutputStreamOperator<R> process(PatternProcessFunction<T,R> patternProcessFunction)
PatternProcessFunction
is called. In order to process timed out partial
matches as well one can use TimedOutPartialMatchHandler
as additional interface.R
- Type of the resulting elementspatternProcessFunction
- The pattern process function which is called for each detected
pattern sequence.DataStream
which contains the resulting elements from the pattern process
function.public <R> SingleOutputStreamOperator<R> process(PatternProcessFunction<T,R> patternProcessFunction, TypeInformation<R> outTypeInfo)
PatternProcessFunction
is called. In order to process timed out partial
matches as well one can use TimedOutPartialMatchHandler
as additional interface.R
- Type of the resulting elementspatternProcessFunction
- The pattern process function which is called for each detected
pattern sequence.outTypeInfo
- Explicit specification of output type.DataStream
which contains the resulting elements from the pattern process
function.public <R> SingleOutputStreamOperator<R> select(PatternSelectFunction<T,R> patternSelectFunction)
PatternSelectFunction
is called. The pattern select function can produce
exactly one resulting element.R
- Type of the resulting elementspatternSelectFunction
- The pattern select function which is called for each detected
pattern sequence.DataStream
which contains the resulting elements from the pattern select
function.public <R> SingleOutputStreamOperator<R> select(PatternSelectFunction<T,R> patternSelectFunction, TypeInformation<R> outTypeInfo)
PatternSelectFunction
is called. The pattern select function can produce
exactly one resulting element.R
- Type of the resulting elementspatternSelectFunction
- The pattern select function which is called for each detected
pattern sequence.outTypeInfo
- Explicit specification of output type.DataStream
which contains the resulting elements from the pattern select
function.public <L,R> SingleOutputStreamOperator<R> select(OutputTag<L> timedOutPartialMatchesTag, PatternTimeoutFunction<T,L> patternTimeoutFunction, PatternSelectFunction<T,R> patternSelectFunction)
PatternSelectFunction
is called. The pattern select function can produce
exactly one resulting element.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternTimeoutFunction
is called. The pattern
timeout function can produce exactly one resulting element.
You can get the stream of timed-out data resulting from the SingleOutputStreamOperator.getSideOutput(OutputTag)
on the SingleOutputStreamOperator
resulting from the select operation with the same OutputTag
.
L
- Type of the resulting timeout elementsR
- Type of the resulting elementstimedOutPartialMatchesTag
- OutputTag
that identifies side output with timed out
patternspatternTimeoutFunction
- The pattern timeout function which is called for each partial
pattern sequence which has timed out.patternSelectFunction
- The pattern select function which is called for each detected
pattern sequence.DataStream
which contains the resulting elements with the resulting timeout
elements in a side output.public <L,R> SingleOutputStreamOperator<R> select(OutputTag<L> timedOutPartialMatchesTag, PatternTimeoutFunction<T,L> patternTimeoutFunction, TypeInformation<R> outTypeInfo, PatternSelectFunction<T,R> patternSelectFunction)
PatternSelectFunction
is called. The pattern select function can produce
exactly one resulting element.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternTimeoutFunction
is called. The pattern
timeout function can produce exactly one resulting element.
You can get the stream of timed-out data resulting from the SingleOutputStreamOperator.getSideOutput(OutputTag)
on the SingleOutputStreamOperator
resulting from the select operation with the same OutputTag
.
L
- Type of the resulting timeout elementsR
- Type of the resulting elementstimedOutPartialMatchesTag
- OutputTag
that identifies side output with timed out
patternspatternTimeoutFunction
- The pattern timeout function which is called for each partial
pattern sequence which has timed out.outTypeInfo
- Explicit specification of output type.patternSelectFunction
- The pattern select function which is called for each detected
pattern sequence.DataStream
which contains the resulting elements with the resulting timeout
elements in a side output.@Deprecated public <L,R> SingleOutputStreamOperator<Either<L,R>> select(PatternTimeoutFunction<T,L> patternTimeoutFunction, PatternSelectFunction<T,R> patternSelectFunction)
select(OutputTag, PatternTimeoutFunction,
PatternSelectFunction)
that returns timed out events as a side-outputPatternSelectFunction
is called. The pattern select function can produce
exactly one resulting element.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternTimeoutFunction
is called. The pattern
timeout function can produce exactly one resulting element.
L
- Type of the resulting timeout elementsR
- Type of the resulting elementspatternTimeoutFunction
- The pattern timeout function which is called for each partial
pattern sequence which has timed out.patternSelectFunction
- The pattern select function which is called for each detected
pattern sequence.DataStream
which contains the resulting elements or the resulting timeout
elements wrapped in an Either
type.public <R> SingleOutputStreamOperator<R> flatSelect(PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
PatternFlatSelectFunction
is called. The pattern flat select function
can produce an arbitrary number of resulting elements.R
- Type of the resulting elementspatternFlatSelectFunction
- The pattern flat select function which is called for each
detected pattern sequence.DataStream
which contains the resulting elements from the pattern flat select
function.public <R> SingleOutputStreamOperator<R> flatSelect(PatternFlatSelectFunction<T,R> patternFlatSelectFunction, TypeInformation<R> outTypeInfo)
PatternFlatSelectFunction
is called. The pattern flat select function
can produce an arbitrary number of resulting elements.R
- Type of the resulting elementspatternFlatSelectFunction
- The pattern flat select function which is called for each
detected pattern sequence.outTypeInfo
- Explicit specification of output type.DataStream
which contains the resulting elements from the pattern flat select
function.public <L,R> SingleOutputStreamOperator<R> flatSelect(OutputTag<L> timedOutPartialMatchesTag, PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction, PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
PatternFlatSelectFunction
is called. The pattern select function can
produce exactly one resulting element.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternFlatTimeoutFunction
is called. The
pattern timeout function can produce exactly one resulting element.
You can get the stream of timed-out data resulting from the SingleOutputStreamOperator.getSideOutput(OutputTag)
on the SingleOutputStreamOperator
resulting from the select operation with the same OutputTag
.
L
- Type of the resulting timeout elementsR
- Type of the resulting elementstimedOutPartialMatchesTag
- OutputTag
that identifies side output with timed out
patternspatternFlatTimeoutFunction
- The pattern timeout function which is called for each
partial pattern sequence which has timed out.patternFlatSelectFunction
- The pattern select function which is called for each
detected pattern sequence.DataStream
which contains the resulting elements with the resulting timeout
elements in a side output.public <L,R> SingleOutputStreamOperator<R> flatSelect(OutputTag<L> timedOutPartialMatchesTag, PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction, TypeInformation<R> outTypeInfo, PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
PatternFlatSelectFunction
is called. The pattern select function can
produce exactly one resulting element.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternFlatTimeoutFunction
is called. The
pattern timeout function can produce exactly one resulting element.
You can get the stream of timed-out data resulting from the SingleOutputStreamOperator.getSideOutput(OutputTag)
on the SingleOutputStreamOperator
resulting from the select operation with the same OutputTag
.
L
- Type of the resulting timeout elementsR
- Type of the resulting elementstimedOutPartialMatchesTag
- OutputTag
that identifies side output with timed out
patternspatternFlatTimeoutFunction
- The pattern timeout function which is called for each
partial pattern sequence which has timed out.patternFlatSelectFunction
- The pattern select function which is called for each
detected pattern sequence.outTypeInfo
- Explicit specification of output type.DataStream
which contains the resulting elements with the resulting timeout
elements in a side output.@Deprecated public <L,R> SingleOutputStreamOperator<Either<L,R>> flatSelect(PatternFlatTimeoutFunction<T,L> patternFlatTimeoutFunction, PatternFlatSelectFunction<T,R> patternFlatSelectFunction)
flatSelect(OutputTag, PatternFlatTimeoutFunction,
PatternFlatSelectFunction)
that returns timed out events as a side-outputPatternFlatSelectFunction
is called. The pattern flat select function
can produce an arbitrary number of resulting elements.
Applies a timeout function to a partial pattern sequence which has timed out. For each
partial pattern sequence the provided PatternFlatTimeoutFunction
is called. The
pattern timeout function can produce an arbitrary number of resulting elements.
L
- Type of the resulting timeout eventsR
- Type of the resulting eventspatternFlatTimeoutFunction
- The pattern flat timeout function which is called for each
partial pattern sequence which has timed out.patternFlatSelectFunction
- The pattern flat select function which is called for each
detected pattern sequence.DataStream
which contains the resulting events from the pattern flat select
function or the resulting timeout events from the pattern flat timeout function wrapped
in an Either
type.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.