Flink之CheckPoint 构建 真正的End-to-End Exactly-Once

五迷三道 提交于 2020-02-13 03:22:48

本博客内容主要讲解: Flink消费Kafka数据写入MySQL模拟Flink端到端精准一次消费

1. 模拟 kafka数据没1s产生一条,产生60条;
2. Flink 消费Kafka,每10一次检查点;
3. 消费到第15条(前面产生一个检查点,不一定是在消费到第10条,因为第一个10s开始时间不一定是从第一条开始算)设置异常数据,数据不会插入
4. 修正异常数据,重启应用程序,Flink重新消费Kafka,数据全部落入MySQL,没有重复,也没有丢失

Exactly-Once 语义

Exactly-Once语义指每个数据输入端的事件只能影响最终结果一次.解释机器出现故障,数据既没有重复,也没有丢失


CheckPoint: 一次CheckPoint进行一次快照;容包含以下内容

  • 应用程序的当前状态
  • 输入流位置

在 Flink 1.4.0 之前,Exactly-Once 语义仅限于 Flink 应用程序内部,并没有扩展到 Flink 数据处理完后发送的大多数外部系统。Flink 应用程序与各种数据输出端进行交互,开发人员需要有能力自己维护组件的上下文来保证 Exactly-Once 语义。


模拟 Kafka->Flink->MySQL 端到端 精准一次消费

主要代码

  • 代码1
package com.huonan.twocommit;

import lombok.extern.slf4j.Slf4j;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.flink.streaming.api.CheckpointingMode;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer011;
import org.apache.flink.streaming.util.serialization.JSONKeyValueDeserializationSchema;

import java.util.Properties;

/**
 * 消费kafka消息,sink(自定义)到mysql中,保证kafka to mysql 的Exactly-Once
 * @author ThinkPad
 */

@Slf4j
public class StreamDemoKafka2Mysql {
    private static final String topic_ExactlyOnce = KafkaUtils.topic_ExactlyOnce;

    public static void main(String[] args) throws Exception {
        final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        //设置并行度,为了方便测试,查看消息的顺序,这里设置为1,可以更改为多并行度
        env.setParallelism(1);
        //checkpoint的设置
        //每隔10s进行启动一个检查点【设置checkpoint的周期】
        env.enableCheckpointing(10000);
        //设置模式为:exactly_one,仅一次语义
        env.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE);
        //确保检查点之间有1s的时间间隔【checkpoint最小间隔】
        env.getCheckpointConfig().setMinPauseBetweenCheckpoints(1000);
        //检查点必须在10s之内完成,或者被丢弃【checkpoint超时时间】
        env.getCheckpointConfig().setCheckpointTimeout(10000);
        //同一时间只允许进行一次检查点
        env.getCheckpointConfig().setMaxConcurrentCheckpoints(1);
        //表示一旦Flink程序被cancel后,会保留checkpoint数据,以便根据实际需要恢复到指定的checkpoint
        //env.getCheckpointConfig().enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION);
        //设置statebackend,将检查点保存在hdfs上面,默认保存在内存中。这里先保存到本地
//        env.setStateBackend(new FsStateBackend("file:///Users/temp/cp/"));

        //设置kafka消费参数
        Properties properties = new Properties();
        properties.setProperty("bootstrap.servers", "192.168.31.100:9092");
// only required for Kafka 0.8
        properties.setProperty("group.id", topic_ExactlyOnce);
        //   Properties props = new Properties();
        //props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, "192.168.31.100:9092");
        //   props.put(ConsumerConfig.GROUP_ID_CONFIG, "test-exactly-Once");
        //kafka分区自动发现周期
        //  props.put(FlinkKafkaConsumerBase.KEY_PARTITION_DISCOVERY_INTERVAL_MILLIS, "3000");

        /*SimpleStringSchema可以获取到kafka消息,JSONKeyValueDeserializationSchema可以获取都消息的key,value,metadata:topic,partition,offset等信息*/
        FlinkKafkaConsumer011<ObjectNode> kafkaConsumer011 = new FlinkKafkaConsumer011<>(
                topic_ExactlyOnce,
                new JSONKeyValueDeserializationSchema(true),
                properties);

        //加入kafka数据源
        DataStreamSource<ObjectNode> streamSource = env.addSource(kafkaConsumer011);
//        System.out.println("streamSource:" + streamSource.print());
        streamSource.print();
        //数据传输到下游
        streamSource.addSink(new MySqlTwoPhaseCommitSink()).name("MySqlTwoPhaseCommitSink");
        //触发执行
        env.execute("StreamDemoKafka2Mysql");
    }
}


  • 代码2
package com.huonan.twocommit;

import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import net.sf.json.JSONObject;
import org.apache.flink.api.common.ExecutionConfig;
import org.apache.flink.api.common.typeutils.base.VoidSerializer;
import org.apache.flink.api.java.typeutils.runtime.kryo.KryoSerializer;
import org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 自定义kafka to mysql,继承TwoPhaseCommitSinkFunction,实现两阶段提交
 * @author ThinkPad
 */
@Slf4j
public class MySqlTwoPhaseCommitSink extends TwoPhaseCommitSinkFunction<ObjectNode,Connection,Void> {

   // private static final Logger log = LoggerFactory.getLogger(MySqlTwoPhaseCommitSink.class);

    public MySqlTwoPhaseCommitSink(){
        super(new KryoSerializer<>(Connection.class,new ExecutionConfig()), VoidSerializer.INSTANCE);
    }

    /**
     * 执行数据库入库操作  task初始化的时候调用
     * @param connection
     * @param objectNode
     * @param context
     * @throws Exception
     */
    @Override
    protected void invoke(Connection connection, ObjectNode objectNode, Context context) throws Exception {
        log.info("start invoke...");
        String date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
        log.info("===>date:" + date + " " + objectNode);
        log.info("===>date:{} --{}",date,objectNode);
        String value = objectNode.get("value").toString();
        JSONObject valueJson = JSONObject.fromObject(value);
        String value_str = (String) valueJson.get("value");
        log.info("objectNode-value:" + value);
        if (value == null||"".equals(value)) {
            return;
        }
        String sql = "insert into `mysqlExactlyOnce_test` (`value`,`insert_time`) values (?,?)";
        log.info("====执行SQL:{}===",sql);
        PreparedStatement ps = connection.prepareStatement(sql);
        ps.setString(1,value);
        Timestamp value_time = new Timestamp(System.currentTimeMillis());
        ps.setTimestamp(2,value_time);
        log.info("要插入的数据:{}--{}",value,value_time);
        //执行insert语句
        ps.execute();
        //手动制造异常
//        if(Integer.parseInt(value_str) == 15) {
//            System.out.println(1 / 0);
//        }
    }

    /**
     * 获取连接,开启手动提交事物(getConnection方法中)
     * @return
     * @throws Exception
     */
    @Override
    protected Connection beginTransaction() throws Exception {
        log.info("start beginTransaction.......");
        String url = "jdbc:mysql://192.168.31.100:3306/test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&useSSL=false&autoReconnect=true";
        Connection connection = DBConnectUtil.getConnection(url, "root", "123456");
        return connection;
    }

    /**
     *预提交,这里预提交的逻辑在invoke方法中
     * @param connection
     * @throws Exception
     */
    @Override
    protected void preCommit(Connection connection) throws Exception {
        log.info("start preCommit...");
    }

    /**
     * 如果invoke方法执行正常,则提交事务
     * @param connection
     */
    @Override
    protected void commit(Connection connection) {
        log.info("start commit...");
        DBConnectUtil.commit(connection);
//        try {
//            Thread.sleep(5000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//            log.error("提交失败!!!");
//        }
    }

    /**
     * 如果invoke执行异常则回滚事物,下一次的checkpoint操作也不会执行
     * @param connection
     */
    @Override
    protected void abort(Connection connection) {
        log.info("start abort rollback...");
        DBConnectUtil.rollback(connection);
    }
}

控制台日志
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : 73be1e1168f91ee2
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumerBase - Consumer subtask 0 will start reading the following 1 partitions from the committed group offsets in Kafka: [KafkaTopicPartition{topic='test_TwoPhaseCommit', partition=0}]
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 1 @ 1581164180635 for job 4903f3b0bee84c38dc337b92d6f3361f.
[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.clients.consumer.ConsumerConfig - ConsumerConfig values: 
	auto.commit.interval.ms = 5000
	auto.offset.reset = latest
	bootstrap.servers = [192.168.31.100:9092]
	check.crcs = true
	client.id = 
	connections.max.idle.ms = 540000
	enable.auto.commit = false
	exclude.internal.topics = true
	fetch.max.bytes = 52428800
	fetch.max.wait.ms = 500
	fetch.min.bytes = 1
	group.id = test_TwoPhaseCommit
	heartbeat.interval.ms = 3000
	interceptor.classes = null
	internal.leave.group.on.close = true
	isolation.level = read_uncommitted
	key.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer
	max.partition.fetch.bytes = 1048576
	max.poll.interval.ms = 300000
	max.poll.records = 500
	metadata.max.age.ms = 300000
	metric.reporters = []
	metrics.num.samples = 2
	metrics.recording.level = INFO
	metrics.sample.window.ms = 30000
	partition.assignment.strategy = [class org.apache.kafka.clients.consumer.RangeAssignor]
	receive.buffer.bytes = 65536
	reconnect.backoff.max.ms = 1000
	reconnect.backoff.ms = 50
	request.timeout.ms = 305000
	retry.backoff.ms = 100
	sasl.jaas.config = null
	sasl.kerberos.kinit.cmd = /usr/bin/kinit
	sasl.kerberos.min.time.before.relogin = 60000
	sasl.kerberos.service.name = null
	sasl.kerberos.ticket.renew.jitter = 0.05
	sasl.kerberos.ticket.renew.window.factor = 0.8
	sasl.mechanism = GSSAPI
	security.protocol = PLAINTEXT
	send.buffer.bytes = 131072
	session.timeout.ms = 10000
	ssl.cipher.suites = null
	ssl.enabled.protocols = [TLSv1.2, TLSv1.1, TLSv1]
	ssl.endpoint.identification.algorithm = null
	ssl.key.password = null
	ssl.keymanager.algorithm = SunX509
	ssl.keystore.location = null
	ssl.keystore.password = null
	ssl.keystore.type = JKS
	ssl.protocol = TLS
	ssl.provider = null
	ssl.secure.random.implementation = null
	ssl.trustmanager.algorithm = PKIX
	ssl.truststore.location = null
	ssl.truststore.password = null
	ssl.truststore.type = JKS
	value.deserializer = class org.apache.kafka.common.serialization.ByteArrayDeserializer

[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version : 0.11.0.2
[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : 73be1e1168f91ee2
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@39fe1aea 成功...
[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Discovered coordinator hadoop000:9092 (id: 2147483647 rack: null) for group test_TwoPhaseCommit.
[flink-akka.actor.default-dispatcher-2] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 1 for job 4903f3b0bee84c38dc337b92d6f3361f (388201 bytes in 2513 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 1 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@2f37325d, transactionStartTime=1581164179408} from checkpoint 1
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
{"value":{"value":"1"},"metadata":{"offset":0,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:26 {"value":{"value":"1"},"metadata":{"offset":0,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:26 --{"value":{"value":"1"},"metadata":{"offset":0,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"1"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"1"}--2020-02-08 20:16:26.456
{"value":{"value":"2"},"metadata":{"offset":1,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:26 {"value":{"value":"2"},"metadata":{"offset":1,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:26 --{"value":{"value":"2"},"metadata":{"offset":1,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"2"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"2"}--2020-02-08 20:16:26.92
{"value":{"value":"3"},"metadata":{"offset":2,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:27 {"value":{"value":"3"},"metadata":{"offset":2,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:27 --{"value":{"value":"3"},"metadata":{"offset":2,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"3"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"3"}--2020-02-08 20:16:27.954
{"value":{"value":"4"},"metadata":{"offset":3,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:28 {"value":{"value":"4"},"metadata":{"offset":3,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:28 --{"value":{"value":"4"},"metadata":{"offset":3,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"4"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"4"}--2020-02-08 20:16:28.936
{"value":{"value":"5"},"metadata":{"offset":4,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:29 {"value":{"value":"5"},"metadata":{"offset":4,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:29 --{"value":{"value":"5"},"metadata":{"offset":4,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"5"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"5"}--2020-02-08 20:16:29.948
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 2 @ 1581164190527 for job 4903f3b0bee84c38dc337b92d6f3361f.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@9c53b92 成功...
{"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:31 {"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:31 --{"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"6"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"6"}--2020-02-08 20:16:31.771
[flink-akka.actor.default-dispatcher-13] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 2 for job 4903f3b0bee84c38dc337b92d6f3361f (438148 bytes in 1516 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 2 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@39fe1aea, transactionStartTime=1581164180804} from checkpoint 2
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
{"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:32 {"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:32 --{"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"7"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"7"}--2020-02-08 20:16:32.152
{"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:33 {"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:33 --{"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"8"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"8"}--2020-02-08 20:16:33.057
{"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:34 {"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:34 --{"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"9"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"9"}--2020-02-08 20:16:34.062
{"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:35 {"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:35 --{"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"10"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"10"}--2020-02-08 20:16:35.075
{"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:36 {"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:36 --{"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"11"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"11"}--2020-02-08 20:16:36.069
{"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:37 {"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:37 --{"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"12"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"12"}--2020-02-08 20:16:37.074
{"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:38 {"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:38 --{"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"13"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"13"}--2020-02-08 20:16:38.071
{"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:39 {"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:39 --{"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"14"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"14"}--2020-02-08 20:16:39.103
{"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:40 {"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:16:40 --{"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"15"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"15"}--2020-02-08 20:16:40.102
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start abort rollback...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.runtime.taskmanager.Task - Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1) (d8d24f87d0606d90cf2c4149e19773e2) switched from RUNNING to FAILED.
java.lang.ArithmeticException: / by zero
MySQL插入数据展示

在这里插入图片描述

重启Flink

日志

[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version : 0.11.0.2
[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : 73be1e1168f91ee2
[Kafka 0.10 Fetcher for Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.kafka.clients.consumer.internals.AbstractCoordinator - Discovered coordinator hadoop000:9092 (id: 2147483647 rack: null) for group test_TwoPhaseCommit.
{"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:41 {"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:41 --{"value":{"value":"6"},"metadata":{"offset":5,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"6"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"6"}--2020-02-08 20:23:41.937
{"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"7"},"metadata":{"offset":6,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"7"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"7"}--2020-02-08 20:23:42.053
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"8"},"metadata":{"offset":7,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"8"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"8"}--2020-02-08 20:23:42.058
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"9"},"metadata":{"offset":8,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"9"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"9"}--2020-02-08 20:23:42.063
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"10"},"metadata":{"offset":9,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"10"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"10"}--2020-02-08 20:23:42.067
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"11"},"metadata":{"offset":10,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"11"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"11"}--2020-02-08 20:23:42.073
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"12"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"12"}--2020-02-08 20:23:42.077
{"value":{"value":"12"},"metadata":{"offset":11,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"16"},"metadata":{"offset":15,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"17"},"metadata":{"offset":16,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"13"},"metadata":{"offset":12,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"13"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"13"}--2020-02-08 20:23:42.092
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"14"},"metadata":{"offset":13,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"14"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"14"}--2020-02-08 20:23:42.097
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"15"},"metadata":{"offset":14,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"15"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"15"}--2020-02-08 20:23:42.103
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"16"},"metadata":{"offset":15,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"16"},"metadata":{"offset":15,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"16"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"16"}--2020-02-08 20:23:42.107
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"17"},"metadata":{"offset":16,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"17"},"metadata":{"offset":16,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"17"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"17"}--2020-02-08 20:23:42.113
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"18"},"metadata":{"offset":17,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"18"},"metadata":{"offset":17,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"18"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"18"}--2020-02-08 20:23:42.118
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"19"},"metadata":{"offset":18,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"19"},"metadata":{"offset":18,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"19"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"19"}--2020-02-08 20:23:42.123
{"value":{"value":"18"},"metadata":{"offset":17,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"19"},"metadata":{"offset":18,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"20"},"metadata":{"offset":19,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"21"},"metadata":{"offset":20,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"20"},"metadata":{"offset":19,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"20"},"metadata":{"offset":19,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"20"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"20"}--2020-02-08 20:23:42.129
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"21"},"metadata":{"offset":20,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"21"},"metadata":{"offset":20,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"21"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"21"}--2020-02-08 20:23:42.146
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"22"},"metadata":{"offset":21,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"22"},"metadata":{"offset":21,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"22"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"22"}--2020-02-08 20:23:42.155
{"value":{"value":"22"},"metadata":{"offset":21,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"23"},"metadata":{"offset":22,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"24"},"metadata":{"offset":23,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"23"},"metadata":{"offset":22,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"23"},"metadata":{"offset":22,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"23"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"23"}--2020-02-08 20:23:42.164
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"24"},"metadata":{"offset":23,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"24"},"metadata":{"offset":23,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"24"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"24"}--2020-02-08 20:23:42.174
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"25"},"metadata":{"offset":24,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"25"},"metadata":{"offset":24,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"25"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"25"}--2020-02-08 20:23:42.184
{"value":{"value":"25"},"metadata":{"offset":24,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"26"},"metadata":{"offset":25,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"27"},"metadata":{"offset":26,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"28"},"metadata":{"offset":27,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"26"},"metadata":{"offset":25,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"26"},"metadata":{"offset":25,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"26"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"26"}--2020-02-08 20:23:42.198
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"27"},"metadata":{"offset":26,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"27"},"metadata":{"offset":26,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"27"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"27"}--2020-02-08 20:23:42.21
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"28"},"metadata":{"offset":27,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"28"},"metadata":{"offset":27,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"28"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"28"}--2020-02-08 20:23:42.217
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"29"},"metadata":{"offset":28,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"29"},"metadata":{"offset":28,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"29"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"29"}--2020-02-08 20:23:42.222
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start invoke...
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 {"value":{"value":"30"},"metadata":{"offset":29,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ===>date:2020-02-08 20:23:42 --{"value":{"value":"30"},"metadata":{"offset":29,"topic":"test_TwoPhaseCommit","partition":0}}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - objectNode-value:{"value":"30"}
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - ====执行SQL:insert into `test_TwoPhaseCommit` (`value`,`insert_time`) values (?,?)===
[Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - 要插入的数据:{"value":"30"}--2020-02-08 20:23:42.227
{"value":{"value":"29"},"metadata":{"offset":28,"topic":"test_TwoPhaseCommit","partition":0}}
{"value":{"value":"30"},"metadata":{"offset":29,"topic":"test_TwoPhaseCommit","partition":0}}
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 1 @ 1581164623870 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@278447fe 成功...
[flink-akka.actor.default-dispatcher-3] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 1 for job 53a5dcc154f25208468215e44cd4e629 (461479 bytes in 2955 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 1 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@74a7a112, transactionStartTime=1581164619994} from checkpoint 1
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 2 @ 1581164633869 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@95b1062 成功...
[flink-akka.actor.default-dispatcher-9] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 2 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 320 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 2 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@278447fe, transactionStartTime=1581164624085} from checkpoint 2
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 3 @ 1581164643868 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@17174574 成功...
[flink-akka.actor.default-dispatcher-9] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 3 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 137 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 3 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@95b1062, transactionStartTime=1581164633925} from checkpoint 3
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 4 @ 1581164653868 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@2330d50 成功...
[flink-akka.actor.default-dispatcher-12] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 4 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 77 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 4 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@17174574, transactionStartTime=1581164643900} from checkpoint 4
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 5 @ 1581164663875 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@1c39cf1d 成功...
[flink-akka.actor.default-dispatcher-17] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 5 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 675 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 5 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@2330d50, transactionStartTime=1581164653900} from checkpoint 5
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 6 @ 1581164673869 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@66ddf181 成功...
[flink-akka.actor.default-dispatcher-17] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 6 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 228 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 6 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@1c39cf1d, transactionStartTime=1581164664254} from checkpoint 6
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 7 @ 1581164683876 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@13ed850d 成功...
[flink-akka.actor.default-dispatcher-9] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 7 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 144 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 7 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@66ddf181, transactionStartTime=1581164673976} from checkpoint 7
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 8 @ 1581164693868 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@709699a1 成功...
[flink-akka.actor.default-dispatcher-17] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 8 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 206 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 8 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@13ed850d, transactionStartTime=1581164683918} from checkpoint 8
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...
[Checkpoint Timer] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Triggering checkpoint 9 @ 1581164703868 for job 53a5dcc154f25208468215e44cd4e629.
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start preCommit...
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start beginTransaction.......
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.DBConnectUtil - 获取连接:com.mysql.jdbc.JDBC4Connection@4cd6b1ac 成功...
[flink-akka.actor.default-dispatcher-24] INFO org.apache.flink.runtime.checkpoint.CheckpointCoordinator - Completed checkpoint 9 for job 53a5dcc154f25208468215e44cd4e629 (388201 bytes in 157 ms).
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO org.apache.flink.streaming.api.functions.sink.TwoPhaseCommitSinkFunction - MySqlTwoPhaseCommitSink 0/1 - checkpoint 9 complete, committing transaction TransactionHolder{handle=com.mysql.jdbc.JDBC4Connection@709699a1, transactionStartTime=1581164693907} from checkpoint 9
[Async calls on Source: Custom Source -> (Sink: Print to Std. Out, Sink: MySqlTwoPhaseCommitSink) (1/1)] INFO com.huonan.twocommit.MySqlTwoPhaseCommitSink - start commit...

MySQL数据,Kafka没在写数据,MySQL数据不多不少

在这里插入图片描述
在测试用遇到问题,启动Flink应用程序报错

[flink-akka.actor.default-dispatcher-45] INFO org.apache.flink.runtime.executiongraph.ExecutionGraph - Source: Custom Source -> Sink: MySqlTwoPhaseCommitSink (1/1) (22a08fab62aca0907f7554fa480f639c) switched from RUNNING to FAILED.
java.lang.Exception: Error while triggering checkpoint 32 for Source: Custom Source -> Sink: MySqlTwoPhaseCommitSink (1/1)
	at org.apache.flink.runtime.taskmanager.Task$1.run(Task.java:1174)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
	at java.util.concurrent.FutureTask.run(FutureTask.java)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.Exception: Could not perform checkpoint 32 for operator Source: Custom Source -> Sink: MySqlTwoPhaseCommitSink (1/1).
	at org.apache.flink.streaming.runtime.tasks.StreamTask.triggerCheckpoint(StreamTask.java:570)
	at org.apache.flink.streaming.runtime.tasks.SourceStreamTask.triggerCheckpoint(SourceStreamTask.java:116)
	at org.apache.flink.runtime.taskmanager.Task$1.run(Task.java:1163)
	... 6 more
Caused by: java.lang.Exception: Could not complete snapshot 32 for operator Source: Custom Source -> Sink: MySqlTwoPhaseCommitSink (1/1).
	at org.apache.flink.streaming.api.operators.AbstractStreamOperator.snapshotState(AbstractStreamOperator.java:422)
	at org.apache.flink.streaming.runtime.tasks.StreamTask$CheckpointingOperation.checkpointStreamOperator(StreamTask.java:1113)
	at org.apache.flink.streaming.runtime.tasks.StreamTask$CheckpointingOperation.executeCheckpointing(StreamTask.java:1055)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.checkpointState(StreamTask.java:729)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.performCheckpoint(StreamTask.java:641)
	at org.apache.flink.streaming.runtime.tasks.StreamTask.triggerCheckpoint(StreamTask.java:564)
	... 8 more
Caused by: com.esotericsoftware.kryo.KryoException: java.lang.UnsupportedOperationException
Serialization trace:
indexToMysqlCharset (com.mysql.jdbc.JDBC4Connection)

各种百度问题查找,最后发现是MySQL版本的问题
5.1.34改为5.1.47就好了

 <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
<!--            <version>5.1.34</version>-->
            <version>5.1.47</version>
        </dependency>


详细代码

Flink-Kafka端到端精准一次处理:详细解读

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!