From 48eda8f46d59c574d8e6636406cfdc2c24ecf916 Mon Sep 17 00:00:00 2001 From: zeek <984294471@qq.com> Date: Tue, 5 May 2020 16:36:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=86=E8=8A=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/thinker/sql/SourceFromMySQL.java | 1 + src/main/java/com/thinker/util/KafkaUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/thinker/sql/SourceFromMySQL.java b/src/main/java/com/thinker/sql/SourceFromMySQL.java index 1544e57..ad208af 100644 --- a/src/main/java/com/thinker/sql/SourceFromMySQL.java +++ b/src/main/java/com/thinker/sql/SourceFromMySQL.java @@ -73,6 +73,7 @@ public class SourceFromMySQL extends RichSourceFunction { @Override public void cancel() { + } private static Connection getConnection() { diff --git a/src/main/java/com/thinker/util/KafkaUtils.java b/src/main/java/com/thinker/util/KafkaUtils.java index 5b87997..9e9f97d 100644 --- a/src/main/java/com/thinker/util/KafkaUtils.java +++ b/src/main/java/com/thinker/util/KafkaUtils.java @@ -34,7 +34,7 @@ public class KafkaUtils { Map fields = new HashMap<>(); tags.put("cluster", "zhisheng"); - tags.put("host_ip", "101.147.022.106"); + tags.put("host_ip", "127.0.0.1"); fields.put("used_percent", 90d); fields.put("max", 27244873d); @@ -53,8 +53,8 @@ public class KafkaUtils { public static void main(String[] args) throws InterruptedException { while (true) { - Thread.sleep(300); writeToKafka(); + Thread.sleep(3000); } }