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 #186: [GEARPUMP-316] Decouple groupBy from w...
Date Wed, 07 Jun 2017 03:20:41 GMT
Github user huafengw commented on a diff in the pull request:

    https://github.com/apache/incubator-gearpump/pull/186#discussion_r120526897
  
    --- Diff: streaming/src/main/scala/org/apache/gearpump/streaming/dsl/window/api/WindowFunction.scala
---
    @@ -32,35 +32,34 @@ object WindowFunction {
       }
     }
     
    -trait WindowFunction[T] {
    +trait WindowFunction {
     
    -  def apply(context: WindowFunction.Context[T]): Array[Window]
    +  def apply[T](context: WindowFunction.Context[T]): Array[Window]
     
       def isNonMerging: Boolean
     }
     
    -abstract class NonMergingWindowFunction[T] extends WindowFunction[T] {
    +abstract class NonMergingWindowFunction extends WindowFunction {
     
       override def isNonMerging: Boolean = true
     }
     
    -case class GlobalWindowFunction[T]() extends NonMergingWindowFunction[T] {
    +case class GlobalWindowFunction() extends NonMergingWindowFunction {
     
    -  override def apply(context: WindowFunction.Context[T]): Array[Window] = {
    +  override def apply[T](context: WindowFunction.Context[T]): Array[Window] = {
         Array(Window(Instant.ofEpochMilli(MIN_TIME_MILLIS),
    --- End diff --
    
    We can create just one static object, no need to create one each time as it's immutable.


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