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
由 2017012 更新
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< ...>
感谢任何可以提供帮助的人。