gearpump-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkasravi <...@git.apache.org>
Subject [GitHub] incubator-gearpump pull request #85: [GEARPUMP-23] add window dsl
Date Tue, 27 Sep 2016 17:28:21 GMT
Github user kkasravi commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/85#discussion_r80744615
  
    --- Diff: streaming/src/main/scala/org/apache/gearpump/streaming/dsl/Stream.scala ---
    @@ -115,20 +121,17 @@ class Stream[T](
        *
        * For example,
        * {{{
    -   * Stream[People].groupBy(_.gender).flatmap(..).filter.(..).reduce(..)
    +   * Stream[People].groupBy(_.gender).flatMap(..).filter(..).reduce(..)
        * }}}
        *
    -   * @param fun  Group by function
    +   * @param fn  Group by function
        * @param parallelism  Parallelism level
        * @param description  The description
        * @return  the grouped stream
        */
    -  def groupBy[Group](fun: T => Group, parallelism: Int = 1, description: String =
null)
    -    : Stream[T] = {
    -    val groupOp = GroupByOp(fun, parallelism, Option(description).getOrElse("groupBy"))
    -    graph.addVertex(groupOp)
    -    graph.addEdge(thisNode, edge.getOrElse(Shuffle), groupOp)
    -    new Stream[T](graph, groupOp)
    +  def groupBy[GROUP](fn: T => GROUP, parallelism: Int = 1, description: String = "groupBy")
    +    : GroupByStream[T, GROUP] = {
    +    groupByWindow(DefaultGroupBy(fn), parallelism, description)
    --- End diff --
    
    Seems odd: groupBy -> groupByWindow -> GroupByStream. Suggests that all groupBy's
have windowing semantics.


---
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