Tag:abstract class

  • Talk about ascendingtimestampextractor of flynk


    order This paper mainly studies the ascendingtimestampextractor of Flink AscendingTimestampExtractor flink-streaming-java_2.11-1.7.0-sources.jar!/org/apache/flink/streaming/api/functions/timestamps/AscendingTimestampExtractor.java /** * A timestamp assigner and watermark generator for streams where timestamps are monotonously * ascending. In this case, the local watermarks for the streams are easy to generate, because * they strictly follow the timestamps. * * @param <T> The type of the […]

  • Talk about flynk’s boundedoutordernesstimestampextractor


    order This article mainly studies the bounded out of orderness timestampextractor of Flink BoundedOutOfOrdernessTimestampExtractor flink-streaming-java_2.11-1.7.0-sources.jar!/org/apache/flink/streaming/api/functions/timestamps/BoundedOutOfOrdernessTimestampExtractor.java /** * This is a {@link AssignerWithPeriodicWatermarks} used to emit Watermarks that lag behind the element with * the maximum timestamp (in event time) seen so far by a fixed amount of time, <code>t_late</code>. This can * help reduce the […]

  • After understanding this set of real interview questions, are you still far from bat?


    preface Recently, the golden nine silver ten is coming. Many people are preparing for the interview, especially summarizing the necessary questions for the interview of Java programmers,This interview list was collected by me since last year. On the one hand, it is for the company’s recruitment. On the other hand, I want to use it […]

  • Talk about the intervaljoin operation of the flyedstream


    order This paper mainly studies the intervaljoin operation of flykeyedstream example DataStream<Integer> orangeStream = … DataStream<Integer> greenStream = … orangeStream .keyBy(<KeySelector>) .intervalJoin(greenStream.keyBy(<KeySelector>)) .between(Time.milliseconds(-2), Time.milliseconds(1)) .process (new ProcessJoinFunction<Integer, Integer, String(){ @Override public void processElement(Integer left, Integer right, Context ctx, Collector<String> out) { out.collect(first + “,” + second); } }); KeyedStream.intervalJoin flink-streaming-java_2.11-1.7.0-sources.jar!/org/apache/flink/streaming/api/datastream/KeyedStream.java @Public public class KeyedStream<T, KEY> […]

  • Let’s talk about flynk’s processfunction


    order This paper mainly studies the process function of Flink example import org.apache.flink.api.common.state.ValueState; import org.apache.flink.api.common.state.ValueStateDescriptor; import org.apache.flink.api.java.tuple.Tuple2; import org.apache.flink.configuration.Configuration; import org.apache.flink.streaming.api.functions.ProcessFunction; import org.apache.flink.streaming.api.functions.ProcessFunction.Context; import org.apache.flink.streaming.api.functions.ProcessFunction.OnTimerContext; import org.apache.flink.util.Collector; // the source data stream DataStream<Tuple2<String, String>> stream = …; // apply the process function onto a keyed stream DataStream<Tuple2<String, Long>> result = stream .keyBy(0) .process(new CountWithTimeoutFunction()); /** […]

  • [design pattern] Abstract Factory


    Abstract factory of design pattern In the previous article, we learned about simple factories. We know that simple factories are places where different classes are created. How are these factories created? With the increase of our business logic, we may need many such simple factories. We can’t take the initiative to create each one. Although […]

  • Let’s talk about where and filter operation of flick table


    order This paper mainly studies the where and filter operations of the flick table Table flink-table_2.11-1.7.0-sources.jar!/org/apache/flink/table/api/table.scala class Table( private[flink] val tableEnv: TableEnvironment, private[flink] val logicalPlan: LogicalNode) { //…… def where(predicate: String): Table = { filter(predicate) } def where(predicate: Expression): Table = { filter(predicate) } def filter(predicate: String): Table = { val predicateExpr = ExpressionParser.parseExpression(predicate) filter(predicateExpr) […]

  • Talk about the orderby and limit of the Flink table


    order This paper mainly studies the orderby and limit of the flick table example Table in = tableEnv.fromDataSet(ds, “a, b, c”); Table result = in.orderBy(“a.asc”); Table in = tableEnv.fromDataSet(ds, “a, b, c”); // returns the first 5 records from the sorted result Table result1 = in.orderBy(“a.asc”).fetch(5); // skips the first 3 records and returns all […]

  • 23 design patterns java version Part 5


    PS: This article is a reprint of the article. You can get the source code by reading the original text. There is a link to the original text at the end of the article PS: This article is about writing strategy mode, method template mode and observer mode 1. Strategy mode A series of algorithms […]

  • Java object oriented programming (OOP)


    Three characteristics 1. Encapsulation, encapsulating the relevant data into a “class” component2. Inheritance is that subclasses automatically share parent class properties and methods, which is a relationship between classes3. Polymorphism to enhance the flexibility and reusability of software class 1. The most basic unit of the Java language is the class, which is similar to […]

  • How to select webclient, httpclient, Httpwebrequest in. Net


    When we call restapi with. Net, we usually have three options:WebClient, HttpWebRequest,HttpClientIn this article, we will discuss how to use these three methods to call the restapi. I will also provide corresponding code cases to help you better understand the concepts and usage of these three methods. In short: HttpWebRequestIt is a relatively low-level way […]

  • Classes and objects in kotlin language


    1. Class A class represents an abstraction of a concrete object. For example, if a person represents a class, then I am a concrete object myself; In the class, attributes describe the object state of the class, and functions describe the object function of the class; Like Java, kotlin uses the class keyword to modify […]