using IF statement to check if, dataStream has some values in Apache Flink -
i generating warnings in cep follows
// generating warnings datastream<joinedstreamevent> warning = patternstream.select( (map<string, joinedstreamevent> value) -> { joinedstreamevent joinedstreamevent = (joinedstreamevent) value.get("start"); return new joinedstreamevent(joinedstreamevent.getpatient_id(), joinedstreamevent.getheartrate(),joinedstreamevent.getrespirationrate()); }// map );
then printing warnings later console, however, want add if statement check, if complex event has been detected or not , perform tasks in if statement
for instance, want print complex events detected follows
, show complex events detected following code
if( warning.tostring() != null){ system.out.println("complex events detected follows : -"); warning.print(); }
here complex event 10,71,71
, output shown follows
i assume logic check if data stream has value in if statement wrong.that reason line "complex events detected follows: -"
getting printed first
is there way that, can check whether datastream has values using if statement , print vlaues. in case, output
complex events detected follows : - 10,71,71
wiki
Comments
Post a Comment