56
56
import org .apache .commons .io .Charsets ;
57
57
import org .apache .commons .lang3 .StringUtils ;
58
58
import org .apache .flink .api .common .typeinfo .TypeInformation ;
59
- import org .apache .flink .api .java .tuple .Tuple2 ;
60
59
import org .apache .flink .api .java .typeutils .RowTypeInfo ;
61
60
import org .apache .flink .streaming .api .datastream .DataStream ;
62
61
import org .apache .flink .streaming .api .environment .StreamExecutionEnvironment ;
65
64
import org .apache .flink .table .api .TableEnvironment ;
66
65
import org .apache .flink .table .api .java .StreamTableEnvironment ;
67
66
import org .apache .flink .table .sinks .TableSink ;
68
- import org .apache .flink .types .Row ;
69
67
import org .slf4j .Logger ;
70
68
import org .slf4j .LoggerFactory ;
71
69
81
79
import java .util .Set ;
82
80
83
81
/**
84
- * 任务执行时的流程方法
82
+ * 任务执行时的流程方法
85
83
* Date: 2020/2/17
86
84
* Company: www.dtstack.com
85
+ *
87
86
* @author maqi
88
87
*/
89
88
public class ExecuteProcessHelper {
@@ -126,11 +125,11 @@ public static ParamsInfo parseParams(String[] args) throws Exception {
126
125
.setConfProp (confProperties )
127
126
.setJarUrlList (jarUrlList )
128
127
.build ();
129
-
130
128
}
131
129
132
130
/**
133
- * 非local模式或者shipfile部署模式,remoteSqlPluginPath必填
131
+ * 非local模式或者shipfile部署模式,remoteSqlPluginPath必填
132
+ *
134
133
* @param remoteSqlPluginPath
135
134
* @param deployMode
136
135
* @param pluginLoadMode
@@ -147,7 +146,7 @@ public static boolean checkRemoteSqlPluginPath(String remoteSqlPluginPath, Strin
147
146
148
147
public static StreamExecutionEnvironment getStreamExecution (ParamsInfo paramsInfo ) throws Exception {
149
148
StreamExecutionEnvironment env = ExecuteProcessHelper .getStreamExeEnv (paramsInfo .getConfProp (), paramsInfo .getDeployMode ());
150
- StreamTableEnvironment tableEnv = getStreamTableEnv (env ,paramsInfo .getConfProp ());
149
+ StreamTableEnvironment tableEnv = getStreamTableEnv (env , paramsInfo .getConfProp ());
151
150
152
151
SqlParser .setLocalSqlPluginRoot (paramsInfo .getLocalSqlPluginPath ());
153
152
SqlTree sqlTree = SqlParser .parseSql (paramsInfo .getSql ());
@@ -188,7 +187,7 @@ public static List<URL> getExternalJarUrls(String addJarListStr) throws java.io.
188
187
189
188
private static void sqlTranslation (String localSqlPluginPath ,
190
189
StreamTableEnvironment tableEnv ,
191
- SqlTree sqlTree ,Map <String , AbstractSideTableInfo > sideTableMap ,
190
+ SqlTree sqlTree , Map <String , AbstractSideTableInfo > sideTableMap ,
192
191
Map <String , Table > registerTableCache ) throws Exception {
193
192
194
193
SideSqlExec sideSqlExec = new SideSqlExec ();
@@ -251,13 +250,14 @@ public static void registerUserDefinedFunction(SqlTree sqlTree, List<URL> jarUrl
251
250
}
252
251
253
252
/**
254
- * 向Flink注册源表和结果表,返回执行时插件包的全路径
253
+ * 向Flink注册源表和结果表,返回执行时插件包的全路径
254
+ *
255
255
* @param sqlTree
256
256
* @param env
257
257
* @param tableEnv
258
258
* @param localSqlPluginPath
259
259
* @param remoteSqlPluginPath
260
- * @param pluginLoadMode 插件加载模式 classpath or shipfile
260
+ * @param pluginLoadMode 插件加载模式 classpath or shipfile
261
261
* @param sideTableMap
262
262
* @param registerTableCache
263
263
* @return
@@ -322,7 +322,8 @@ public static Set<URL> registerTable(SqlTree sqlTree, StreamExecutionEnvironment
322
322
}
323
323
324
324
/**
325
- * perjob模式将job依赖的插件包路径存储到cacheFile,在外围将插件包路径传递给jobgraph
325
+ * perjob模式将job依赖的插件包路径存储到cacheFile,在外围将插件包路径传递给jobgraph
326
+ *
326
327
* @param env
327
328
* @param classPathSet
328
329
*/
0 commit comments