Github user manuzhang commented on a diff in the pull request: https://github.com/apache/incubator-gearpump/pull/67#discussion_r72599381 --- Diff: examples/streaming/kafka/src/main/scala/org/apache/gearpump/streaming/examples/kafka/KafkaReadWrite.scala --- @@ -86,4 +90,30 @@ object KafkaReadWrite extends AkkaApp with ArgumentsParser { val appId = context.submit(application(config, context.system)) context.close() } + + + class EventTimeKafkaMessageDecoder extends KafkaMessageDecoder { + private var count = 0 + private var localMin = Long.MaxValue + private var watermark = 0L + private val LOG = LogUtil.getLogger(classOf[EventTimeKafkaMessageDecoder]) + /** + * @param key key of a kafka message, can be NULL + * @param value value of a kafka message + * @return a gearpump Message + */ + override def fromBytes(key: Array[Byte], value: Array[Byte]): MessageAndWatermark = { + Injection.invert[Long, Array[Byte]](key).map { eventTime => + if (count == 10) { + watermark = localMin --- End diff -- this is just one example of watermark which is aligned with the way event timestamp generated by `KafkaWriter`. I'd better remove it immediately without causing further confusions.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---