Skip to content

Commit c0ba07d

Browse files
更新代码
2 parents 73befd6 + 76c588f commit c0ba07d

File tree

5 files changed

+17
-53
lines changed

5 files changed

+17
-53
lines changed

core/src/main/java/com/dtstack/flink/sql/exec/ExecuteProcessHelper.java

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,18 @@
1818

1919
package com.dtstack.flink.sql.exec;
2020

21-
import ch.qos.logback.classic.Level;
22-
import ch.qos.logback.classic.LoggerContext;
21+
import org.apache.flink.api.common.typeinfo.TypeInformation;
22+
import org.apache.flink.api.java.tuple.Tuple2;
23+
import org.apache.flink.api.java.typeutils.RowTypeInfo;
24+
import org.apache.flink.streaming.api.datastream.DataStream;
25+
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
26+
import org.apache.flink.table.api.StreamQueryConfig;
27+
import org.apache.flink.table.api.Table;
28+
import org.apache.flink.table.api.TableEnvironment;
29+
import org.apache.flink.table.api.java.StreamTableEnvironment;
30+
import org.apache.flink.table.sinks.TableSink;
31+
import org.apache.flink.types.Row;
32+
2333
import com.dtstack.flink.sql.classloader.ClassLoaderManager;
2434
import com.dtstack.flink.sql.config.CalciteConfig;
2535
import com.dtstack.flink.sql.enums.ClusterMode;
@@ -55,17 +65,6 @@
5565
import org.apache.calcite.sql.SqlNode;
5666
import org.apache.commons.io.Charsets;
5767
import org.apache.commons.lang3.StringUtils;
58-
import org.apache.flink.api.common.typeinfo.TypeInformation;
59-
import org.apache.flink.api.java.tuple.Tuple2;
60-
import org.apache.flink.api.java.typeutils.RowTypeInfo;
61-
import org.apache.flink.streaming.api.datastream.DataStream;
62-
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
63-
import org.apache.flink.table.api.StreamQueryConfig;
64-
import org.apache.flink.table.api.Table;
65-
import org.apache.flink.table.api.TableEnvironment;
66-
import org.apache.flink.table.api.java.StreamTableEnvironment;
67-
import org.apache.flink.table.sinks.TableSink;
68-
import org.apache.flink.types.Row;
6968
import org.slf4j.Logger;
7069
import org.slf4j.LoggerFactory;
7170

@@ -110,7 +109,6 @@ public static ParamsInfo parseParams(String[] args) throws Exception {
110109
String remoteSqlPluginPath = options.getRemoteSqlPluginPath();
111110
String pluginLoadMode = options.getPluginLoadMode();
112111
String deployMode = options.getMode();
113-
String logLevel = options.getLogLevel();
114112

115113
Preconditions.checkArgument(checkRemoteSqlPluginPath(remoteSqlPluginPath, deployMode, pluginLoadMode),
116114
"Non-local mode or shipfile deployment mode, remoteSqlPluginPath is required");
@@ -128,7 +126,6 @@ public static ParamsInfo parseParams(String[] args) throws Exception {
128126
.setDeployMode(deployMode)
129127
.setConfProp(confProperties)
130128
.setJarUrlList(jarURList)
131-
.setLogLevel(logLevel)
132129
.build();
133130

134131
}
@@ -154,8 +151,6 @@ public static StreamExecutionEnvironment getStreamExecution(ParamsInfo paramsInf
154151
StreamTableEnvironment tableEnv = StreamTableEnvironment.create(env);
155152
StreamQueryConfig streamQueryConfig = StreamEnvConfigManager.getStreamQueryConfig(tableEnv, paramsInfo.getConfProp());
156153

157-
setLogLevel(paramsInfo.getLogLevel());
158-
159154
SqlParser.setLocalSqlPluginRoot(paramsInfo.getLocalSqlPluginPath());
160155
SqlTree sqlTree = SqlParser.parseSql(paramsInfo.getSql());
161156

@@ -348,11 +343,5 @@ public static StreamExecutionEnvironment getStreamExeEnv(Properties confProperti
348343
return env;
349344
}
350345

351-
private static void setLogLevel(String level){
352-
LoggerContext loggerContext= (LoggerContext) LoggerFactory.getILoggerFactory();
353-
//设置全局日志级别
354-
ch.qos.logback.classic.Logger logger = loggerContext.getLogger("root");
355-
logger.setLevel(Level.toLevel(level, Level.INFO));
356-
}
357346

358347
}

core/src/main/java/com/dtstack/flink/sql/exec/ParamsInfo.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,17 @@ public class ParamsInfo {
3838
private String remoteSqlPluginPath;
3939
private String pluginLoadMode;
4040
private String deployMode;
41-
private String logLevel;
4241
private Properties confProp;
4342

4443
public ParamsInfo(String sql, String name, List<URL> jarUrlList, String localSqlPluginPath,
45-
String remoteSqlPluginPath, String pluginLoadMode, String deployMode, String logLevel, Properties confProp) {
44+
String remoteSqlPluginPath, String pluginLoadMode, String deployMode, Properties confProp) {
4645
this.sql = sql;
4746
this.name = name;
4847
this.jarUrlList = jarUrlList;
4948
this.localSqlPluginPath = localSqlPluginPath;
5049
this.remoteSqlPluginPath = remoteSqlPluginPath;
5150
this.pluginLoadMode = pluginLoadMode;
5251
this.deployMode = deployMode;
53-
this.logLevel = logLevel;
5452
this.confProp = confProp;
5553
}
5654

@@ -86,9 +84,6 @@ public Properties getConfProp() {
8684
return confProp;
8785
}
8886

89-
public String getLogLevel() {
90-
return logLevel;
91-
}
9287

9388
@Override
9489
public String toString() {
@@ -100,7 +95,6 @@ public String toString() {
10095
", remoteSqlPluginPath='" + remoteSqlPluginPath + '\'' +
10196
", pluginLoadMode='" + pluginLoadMode + '\'' +
10297
", deployMode='" + deployMode + '\'' +
103-
", logLevel='" + logLevel + '\'' +
10498
", confProp=" + confProp +
10599
'}';
106100
}
@@ -160,10 +154,6 @@ public ParamsInfo.Builder setDeployMode(String deployMode) {
160154
return this;
161155
}
162156

163-
public ParamsInfo.Builder setLogLevel(String logLevel) {
164-
this.logLevel = logLevel;
165-
return this;
166-
}
167157

168158
public ParamsInfo.Builder setConfProp(Properties confProp) {
169159
this.confProp = confProp;
@@ -172,7 +162,7 @@ public ParamsInfo.Builder setConfProp(Properties confProp) {
172162

173163
public ParamsInfo build() {
174164
return new ParamsInfo(sql, name, jarUrlList, localSqlPluginPath,
175-
remoteSqlPluginPath, pluginLoadMode, deployMode, logLevel, confProp);
165+
remoteSqlPluginPath, pluginLoadMode, deployMode, confProp);
176166
}
177167
}
178168
}

core/src/main/java/com/dtstack/flink/sql/option/Options.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ public class Options {
6969
@OptionRequired(description = "plugin load mode, by classpath or shipfile")
7070
private String pluginLoadMode = EPluginLoadMode.CLASSPATH.name();
7171

72-
private String logLevel;
73-
7472
public String getMode() {
7573
return mode;
7674
}
@@ -175,11 +173,4 @@ public void setPluginLoadMode(String pluginLoadMode) {
175173
this.pluginLoadMode = pluginLoadMode;
176174
}
177175

178-
public String getLogLevel() {
179-
return logLevel;
180-
}
181-
182-
public void setLogLevel(String logLevel) {
183-
this.logLevel = logLevel;
184-
}
185176
}

kudu/kudu-sink/src/main/java/com/dtstack/flink/sql/sink/kudu/KuduOutputFormat.java

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,12 @@
1818

1919
package com.dtstack.flink.sql.sink.kudu;
2020

21+
import com.dtstack.flink.sql.outputformat.DtRichOutputFormat;
2122
import org.apache.flink.api.common.typeinfo.TypeInformation;
2223
import org.apache.flink.api.java.tuple.Tuple2;
2324
import org.apache.flink.configuration.Configuration;
2425
import org.apache.flink.types.Row;
25-
26-
import com.dtstack.flink.sql.outputformat.DtRichOutputFormat;
27-
import org.apache.kudu.client.AsyncKuduClient;
28-
import org.apache.kudu.client.AsyncKuduSession;
29-
import org.apache.kudu.client.KuduClient;
30-
import org.apache.kudu.client.KuduException;
31-
import org.apache.kudu.client.KuduTable;
32-
import org.apache.kudu.client.Operation;
33-
import org.apache.kudu.client.PartialRow;
26+
import org.apache.kudu.client.*;
3427
import org.slf4j.Logger;
3528
import org.slf4j.LoggerFactory;
3629

redis5/redis5-sink/src/main/java/com/dtstack/flink/sql/sink/redis/table/RedisSinkParser.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.google.common.collect.Lists;
2525
import org.apache.commons.lang3.StringUtils;
2626

27+
import java.util.ArrayList;
2728
import java.util.Arrays;
2829
import java.util.List;
2930
import java.util.Map;

0 commit comments

Comments
 (0)