Pattern< Tuple3< String, String, String >, ? > pattern = Pattern.<Tuple3< String, String, String > > begin( "start" )
.next( "3" ).where( new FilterFunction< Tuple3< String, String, String > >() {
@Override
public boolean filter ( Tuple3< String, String, String > value ) throws Exception {
return value.f2.equals( "3" );
}
} )
.next( "4" ).subtype(Tuple.getTupleClass( 2 )).where( new FilterFunction< Tuple2< String, String> >() {
@Override
public boolean filter ( Tuple2< String, String > value ) throws Exception {
return value.f1.equals( "3" );
}
} )
subtype(Tuple.getTupleClass( 2 ))、およびエラーが発生しました
Inferred type 'capture<? extends org.apapche.flink.api.java.tuple.Tuple>' for type parameter 'S' is not within its bound;should extend 'org.apapche.flink.api.java.tuple.Tuple3<java.lang.String,java.lang.String,java.lang.String>'
これを変更する必要がありますか?しかし、どのように?Pattern< Tuple3< String, String, String >, ? > pattern
2017年までに更新012
JoinedStreams< Tuple2< String, String >, Tuple3< String, String, String > >.Where< String >.EqualTo
joinedStreams = someStream
.join( otherStream )
.where( value -> value.f1 )
.equalTo( value -> value.f1 );
Pattern< Tuple, ? > pattern = Pattern.< Tuple > begin( "start" )
.subtype( Tuple3.class )
.where( evt -> evt.f2.equals( "3" ) )
.next( "4" )
.subtype( Tuple2.class )
.where( evt -> evt.f1.equals( "3" ) )
.within( Time.seconds( 10 ) );
PatternStream< ...> patternStream = CEP.pattern( joinedStreams, pattern );
私はこれを試しましたが、何を記入する必要はありませんPatternStream< ...>
.助けを提供できる人に感謝します.