我正在编写一个简单的代码来测试Scala中的CEP library
,maven依赖版 1.1-SNAPSHOT 。我的代码:
val res = igd.filter(_._2 == 13)
val pattern: Pattern[(Long,String,String,Long), _] = Pattern.begin[(Long,String,String,Long)]("start").where(_._3 == true).next("end").where(_._3 == false)
val patternStream: PatternStream[(Long,String,String,Long)] = CEP.pattern(res, pattern)
def selectFn(pattern : mutable.Map[String,(Long,String,String,Long)]): String = {
val startEvent = pattern.get("start").get
"Alerta:"+startEvent._1+": Pattern"
}
val patternStreamSelected = patternStream.select(selectFn(_)).print
在selecFn
中,地图显示为红色,并显示消息cannot resolve symbol Map
问题出在哪儿??先感谢您。
答案 0 :(得分:0)
哦,我的...,我正在导入scala.collection.parallel.mutable
而不是scala.collection.mutable
。无论如何,我认为scala lib仍然不起作用,我的小测试没有做到,你可以阅读Simple Scala API for CEP example don't show any output