flink观看更新

This commit is contained in:
markilue 2023-02-24 21:15:29 +08:00
parent 1f674b6b56
commit 6e66e33c27
4 changed files with 32 additions and 34 deletions

View File

@ -1,9 +1,9 @@
package day01.scala package day01.scala
//import org.apache.flink.api.common.functions.FlatMapFunction import org.apache.flink.api.common.functions.FlatMapFunction
//import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
//import org.apache.flink.util.Collector import org.apache.flink.util.Collector
object Example_scala1 { object Example_scala1 {

View File

@ -58,35 +58,35 @@ public class Example2 {
.print(); .print();
//匿名内部类的方式 //匿名内部类的方式
// env env
// .addSource(new SourceFunction<Integer>() { .addSource(new SourceFunction<Integer>() {
//
// private boolean running = true; private boolean running = true;
// private Random random = new Random(); private Random random = new Random();
//
//
// @Override @Override
// public void run(SourceContext<Integer> ctx) throws Exception { public void run(SourceContext<Integer> ctx) throws Exception {
//
// while (running) { while (running) {
// ctx.collect(random.nextInt(1000)); ctx.collect(random.nextInt(1000));
// Thread.sleep(1000L); Thread.sleep(1000L);
// } }
//
// } }
//
// @Override @Override
// public void cancel() { public void cancel() {
// running = false; running = false;
//
// } }
// }) })
// .map(new MapFunction<Integer, Tuple2<Integer, Integer>>() { .map(new MapFunction<Integer, Tuple2<Integer, Integer>>() {
// @Override @Override
// public Tuple2<Integer, Integer> map(Integer value) throws Exception { public Tuple2<Integer, Integer> map(Integer value) throws Exception {
// return Tuple2.of(value, value); return Tuple2.of(value, value);
// } }
// }).print(); }).print();
//外部类的方式 //外部类的方式

View File

@ -11,7 +11,6 @@ import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction; import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.streaming.api.functions.source.SourceFunction; import org.apache.flink.streaming.api.functions.source.SourceFunction;
import org.apache.flink.util.Collector; import org.apache.flink.util.Collector;
import sun.awt.SunHints;
import java.sql.Time; import java.sql.Time;
import java.sql.Timestamp; import java.sql.Timestamp;

View File

@ -12,7 +12,6 @@ import org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment; import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.KeyedProcessFunction; import org.apache.flink.streaming.api.functions.KeyedProcessFunction;
import org.apache.flink.util.Collector; import org.apache.flink.util.Collector;
import sun.awt.geom.AreaOp;
import java.util.HashMap; import java.util.HashMap;