Flink uses a lot of generics programming, which is an executor Framework with cluster of executor having a lot of thread for task by RPC communication(Actor System). The data and the process of data are defined by user. Event-Driven == Callback funct…
The beginning of this chapter introduced the idea of writing code that can be applied as generally as possible. To do this, we need ways to loosen the constraints on the types that our code works with, without losing the benefits of static type check…
Ordinary classes and methods work with specific types: either primitives or class types. If you are writing code that might be used across more types, this rigidity can be overconstraining. One way that object-oriented languages allow generalization…
Example Program The following program is a complete, working example of streaming window word count application, that counts the words coming from a web socket in 5 second windows. public class WindowWordCount { public static void main(String[] args)…
https://ci.apache.org/projects/flink/flink-docs-release-0.10/apis/programming_guide.html Example Program 编程的风格和spark很类似, ExecutionEnvironment -- SparkContext DataSet – RDD Transformations 这里用Java的接口,所以传入function需要用FlatMapFunction类对象 public clas…
目录 Chapter 8. Refactoring, testing, and debugging Chapter 9. Default methods Chapter 10. Using Optional as a better alternative to null Chapter 11. CompletableFuture: composable asynchronous programming Chapter 12. New Date and Time API(未完) Chapter 8…
2.4 The Get and Put Principle Get and Put Principle: 用于取对象的泛型集合,声明为 <? extends T> 用于存对象的泛型集合,声明为 <? super T> 如果同时存取,那么还是老老实实的用< T>吧 注意: void put(List<? extends Number> nums){ nums.add(?) } 上面代码中'?'处只能放入null值,因为你并不能确定nums具体是什么类型的Lis…
2.3 Wildcards with super 这里就直接拿书上的例子好了,这是Collections里面的一个方法: public static <T> void copy(List<? super T> dst,List<? extends T> src){ for(int i = 0; i < src.size(); i++){ dst.set(i,src.get(i)); } } 其中<? super T> 表示T以以及T的父类,java的泛…