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

feat: remove parallelism options parameter, more compatibility (#1868)

* feat: remove parallelism options parameter, more compatibility * Spotless Apply --------- Co-authored-by: 's avatarleechor <leechor@users.noreply.github.com>
parent 5c5f75cc
......@@ -33,7 +33,7 @@ public class WatchStatementExplainer {
public static final String CREATE_SQL_TEMPLATE =
"CREATE TABLE print_{0} WITH (''connector'' = ''printnet'', "
+ "''port''=''{2,number,#}'', ''hostName'' = ''{1}'', ''sink.parallelism''=''{3}'')\n"
+ "''port''=''{2,number,#}'', ''hostName'' = ''{1}'')\n"
+ "AS SELECT * FROM {0}";
public static final int PORT = 7125;
......@@ -52,7 +52,7 @@ public class WatchStatementExplainer {
public String getCreateStatement(String tableName) {
Optional<InetAddress> address = getSystemLocalIp();
String ip = address.isPresent() ? address.get().getHostAddress() : "127.0.0.1";
return MessageFormat.format(CREATE_SQL_TEMPLATE, tableName, ip, PORT, 1);
return MessageFormat.format(CREATE_SQL_TEMPLATE, tableName, ip, PORT);
}
private static Optional<InetAddress> getSystemLocalIp() {
......
......@@ -39,7 +39,6 @@ public class PrintNetDynamicTableSink implements DynamicTableSink, SupportsParti
private final int port;
private final EncodingFormat<SerializationSchema<RowData>> encodingFormat;
private final DataType type;
private final int parallelism;
private final List<String> partitionKeys;
private String printIdentifier;
private ObjectIdentifier objectIdentifier;
......@@ -51,14 +50,12 @@ public class PrintNetDynamicTableSink implements DynamicTableSink, SupportsParti
EncodingFormat<SerializationSchema<RowData>> serializingFormat,
String hostname,
int port,
int parallelism,
String printIdentifier,
ObjectIdentifier objectIdentifier) {
this.hostname = hostname;
this.port = port;
this.encodingFormat = serializingFormat;
this.type = type;
this.parallelism = parallelism;
this.partitionKeys = partitionKeys;
this.printIdentifier = printIdentifier;
this.objectIdentifier = objectIdentifier;
......@@ -88,8 +85,7 @@ public class PrintNetDynamicTableSink implements DynamicTableSink, SupportsParti
});
return SinkFunctionProvider.of(
new PrintNetSinkFunction(hostname, port, serializer, converter, printIdentifier),
parallelism);
new PrintNetSinkFunction(hostname, port, serializer, converter, printIdentifier));
}
@Override
......@@ -100,7 +96,6 @@ public class PrintNetDynamicTableSink implements DynamicTableSink, SupportsParti
encodingFormat,
hostname,
port,
parallelism,
printIdentifier,
objectIdentifier);
}
......
......@@ -80,7 +80,6 @@ public class PrintNetDynamicTableSinkFactory implements DynamicTableSinkFactory
serializingFormat,
options.get(HOSTNAME),
options.get(PORT),
options.get(FactoryUtil.SINK_PARALLELISM),
options.get(PRINT_IDENTIFIER),
objectIdentifier);
}
......@@ -97,7 +96,6 @@ public class PrintNetDynamicTableSinkFactory implements DynamicTableSinkFactory
@Override
public Set<ConfigOption<?>> optionalOptions() {
return new HashSet<>(
Arrays.asList(PRINT_IDENTIFIER, FactoryUtil.SINK_PARALLELISM, FactoryUtil.FORMAT));
return new HashSet<>(Arrays.asList(PRINT_IDENTIFIER, FactoryUtil.FORMAT));
}
}
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