gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From huafengw <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #67: fix GEARPUMP-32, introduce source water...
Date Wed, 27 Jul 2016 10:03:56 GMT
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/67#discussion_r72412991
  
    --- 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) {
    --- End diff --
    
    count % 10 == 0 ?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message