Unverified Commit 8fe4d41e authored by Licho's avatar Licho Committed by GitHub

Add dinky port configure (#2791)

* fix: print like problem Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * feat: add diny port suggestion Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> * chore: add some log Signed-off-by: 's avatarlicho <lecho.sun@gmail.com> --------- Signed-off-by: 's avatarlicho <lecho.sun@gmail.com>
parent 06ff57bb
...@@ -115,6 +115,7 @@ public class PrintTableServiceImpl implements PrintTableService { ...@@ -115,6 +115,7 @@ public class PrintTableServiceImpl implements PrintTableService {
InetAddress host = null; InetAddress host = null;
try { try {
host = InetAddress.getByName("0.0.0.0"); host = InetAddress.getByName("0.0.0.0");
log.info("PrintTableListener:DatagramSocket init success, host: {}, port: {}", host, port);
return new DatagramSocket(port, host); return new DatagramSocket(port, host);
} catch (SocketException | UnknownHostException e) { } catch (SocketException | UnknownHostException e) {
log.error( log.error(
......
...@@ -42,4 +42,7 @@ public class CustomerConfigureOptions { ...@@ -42,4 +42,7 @@ public class CustomerConfigureOptions {
public static final ConfigOption<String> DINKY_HOST = public static final ConfigOption<String> DINKY_HOST =
key("dinky.dinkyHost").stringType().noDefaultValue().withDescription("dinky local address"); key("dinky.dinkyHost").stringType().noDefaultValue().withDescription("dinky local address");
public static final ConfigOption<Integer> DINKY_PORT =
key("dinky.dinkyPort").intType().defaultValue(7125).withDescription("dinky local port");
} }
...@@ -55,6 +55,7 @@ public class PrintNetSinkFunction extends RichSinkFunction<RowData> { ...@@ -55,6 +55,7 @@ public class PrintNetSinkFunction extends RichSinkFunction<RowData> {
try { try {
this.targetAddress = InetAddress.getByName(hostname); this.targetAddress = InetAddress.getByName(hostname);
log.info("PrintNetSinkFunction target address: {}, port: {}", hostname, port);
} catch (UnknownHostException e) { } catch (UnknownHostException e) {
log.error("Unknown host: {}", hostname); log.error("Unknown host: {}", hostname);
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -68,7 +69,6 @@ public class PrintNetSinkFunction extends RichSinkFunction<RowData> { ...@@ -68,7 +69,6 @@ public class PrintNetSinkFunction extends RichSinkFunction<RowData> {
serializer.open(null); serializer.open(null);
} }
// StreamingRuntimeContext context = (StreamingRuntimeContext) getRuntimeContext();
socket = new DatagramSocket(); socket = new DatagramSocket();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment