Created
March 14, 2015 13:45
-
-
Save akshaydixi/f4f0e3097bc26c14ec64 to your computer and use it in GitHub Desktop.
Testing foldWindow for FLINK-1450
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.dixit.flinktrial | |
import java.util.concurrent.TimeUnit | |
import org.apache.flink.streaming.api.scala._ | |
import org.apache.flink.streaming.api.windowing.helper.Time | |
object SocketTextStreamWordCount { | |
def main(args: Array[String]) { | |
val hostName = args(0) | |
val port = args(1).toInt | |
val env = StreamExecutionEnvironment.getExecutionEnvironment | |
val text = env.socketTextStream(hostName, port).window(Time.of(1, TimeUnit.MINUTES)).every(Time.of(10,TimeUnit.SECONDS)).foldWindow(0, (x: Int, y: Any) => x + 1) | |
text print() | |
env.execute("Testing foldWindow") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Exception in thread "main"
org.apache.flink.api.common.functions.InvalidTypesException
: Type of TypeVariable 'T' in 'classorg.apache.flink.streaming.api.scala.WindowedDataStream
' could not be determined. This is most likely a type erasure problem. The type extraction currently supports types with generic variables only in cases where all variables in the return type can be deduced from the input type(s).