Flink多个Sink的实现

在实际的生产环境中,我们的Flink任务可能需要同时写入多个存储,也就说会有多个sink,当然Flink是支持多个Sink,而且多个sink之间是并行的关系,互相也没有影响,具体的实现代码如下:

package flink.table

import java.sql.Timestamp
import java.util.TimeZone
import flink.util.CommonUtils
import org.apache.flink.api.common.time.Time
import org.apache.flink.configuration.Configuration
import org.apache.flink.streaming.api.{CheckpointingMode, TimeCharacteristic}
import org.apache.flink.streaming.api.functions.sink.RichSinkFunction
import org.apache.flink.table.api.TableEnvironment
import org.apache.flink.table.api.scala._
import org.apache.flink.streaming.api.scala.{StreamExecutionEnvironment, _}
import org.apache.hadoop.hbase.{HBaseConfiguration, TableName}
import org.apache.hadoop.hbase.client._
import org.apache.hadoop.hbase.util.Bytes
import org.apache.flink.streaming.connectors.fs.bucketing.{BucketingSink, DateTimeBucketer}
import org.apache.flink.streaming.connectors.fs.StringWriter

/**
  * Flink SQL基于Process

你可能感兴趣的:(Flink,Flink,多个sink)