【实战】Flink实现统计每个小时的各类日志条数

Flink实现统计每个小时的各类日志条数

import java.text.SimpleDateFormat
import java.util.{Date, Properties}
import org.apache.flink.api.scala._
import com.google.gson.{JsonObject, JsonParser}
import com.iflytekzunhong.util.RedisPoolUtil
import org.apache.flink.api.common.functions.{AggregateFunction, ReduceFunction}
import org.apache.flink.api.common.serialization.SimpleStringSchema
import org.apache.flink.api.common.state.{ValueState, ValueStateDescriptor}
import org.apache.flink.api.scala.typeutils.Types
import org.apache.flink.streaming.api.TimeCharacteristic
import org.apache.flink.streaming.api.functions.timestamps.BoundedOutOfOrdernessTimestampExtractor
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.scala.function.WindowFunction
import org.apache.flink.streaming.api.windowing.assigners.{TumblingEventTimeWindows, TumblingProcessingTimeWindows}
import org.apache.flink.streaming.api.windowing.evictors.TimeEvictor
import org.apache.flink.streaming.api.windowing.time.Time
import org.apache.flink.streaming.api.windowing.triggers.{ContinuousEventTimeTrigger, Trigger, TriggerResult}
import org.apache.flink.streaming.api.windowing.windows.TimeWindow
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer010
import org.apache.flink.util.Collector
import org.apache.log4j.{Level, Logger}



object FlinkDemand3 {
  Logger.getLogger("org").setLevel(Level.ERROR)
  var logs = ""

  case cl

你可能感兴趣的:(flink,hive,flink,触发器,大数据)