We are using flink-cep as a standalone library for finding out patterns in a list of events.
Given the following list of events:
val patientKey = "patient"
val hrKey = "hr"
// Event
val p1e1 = Event("hr", mapOf(patientKey to 1, hr to 1))
val p1e2 = Event("hr", mapOf(patientKey to 1, hr to 2))
val p2e1 = Event("hr", mapOf(patientKey to 2, hr to 1))
val p1e3 = Event("hr", mapOf(patientKey to 1, hr to 3))
val p2e2 = Event("hr", mapOf(patientKey to 2, hr to 2))
val p3e1 = Event("hr", mapOf(patientKey to 3, hr to 1))
val p2e3 = Event("hr", mapOf(patientKey to 2, hr to 3))
val p3e2 = Event("hr", mapOf(patientKey to 3, hr to 2))
val p3e3 = Event("hr", mapOf(patientKey to 3, hr to 3))
We would like to write a pattern which returns as matches:
first match: p1e1, p1e2, p1e3
second match: p2e1, p2e2, p2e3
third match: p3e1, p3e2, p3e3
As such, this seems to be doable running CEP in a flink environment with keyed streams, but how do we do it without keyed streams. We cannot deploy a full flink env as we are running on a constrained device.
We would like to get all the heart rates gathered for a patient within 5 seconds.
Thanks