2020
2121package com .dtstack .flink .sql .launcher ;
2222
23+ import com .dtstack .flink .sql .constrant .ConfigConstrant ;
2324import com .google .common .collect .Lists ;
2425import com .alibaba .fastjson .JSON ;
2526import com .alibaba .fastjson .TypeReference ;
2930import com .dtstack .flink .sql .option .OptionParser ;
3031import com .dtstack .flink .sql .option .Options ;
3132import com .dtstack .flink .sql .util .PluginUtil ;
33+ import org .apache .commons .io .Charsets ;
3234import org .apache .commons .lang .BooleanUtils ;
3335import org .apache .commons .lang .StringUtils ;
3436import org .apache .flink .client .program .ClusterClient ;
4446import java .io .FileInputStream ;
4547import java .io .IOException ;
4648import java .io .InputStreamReader ;
49+ import java .net .URLDecoder ;
4750import java .util .LinkedList ;
4851import java .util .List ;
4952import java .util .Map ;
53+ import java .util .Properties ;
5054
5155/**
5256 * Date: 2017/2/20
@@ -75,6 +79,10 @@ public static void main(String[] args) throws Exception {
7579 String mode = launcherOptions .getMode ();
7680 List <String > argList = optionParser .getProgramExeArgList ();
7781
82+ String confProp = launcherOptions .getConfProp ();
83+ confProp = URLDecoder .decode (confProp , Charsets .UTF_8 .toString ());
84+ Properties confProperties = PluginUtil .jsonStrToObject (confProp , Properties .class );
85+
7886 if (mode .equals (ClusterMode .local .name ())) {
7987 String [] localArgs = argList .toArray (new String [argList .size ()]);
8088 Main .main (localArgs );
@@ -86,8 +94,10 @@ public static void main(String[] args) throws Exception {
8694 String [] remoteArgs = argList .toArray (new String [argList .size ()]);
8795 PackagedProgram program = new PackagedProgram (jarFile , Lists .newArrayList (), remoteArgs );
8896
89- if (StringUtils .isNotBlank (launcherOptions .getSavePointPath ())){
90- program .setSavepointRestoreSettings (SavepointRestoreSettings .forPath (launcherOptions .getSavePointPath (), BooleanUtils .toBoolean (launcherOptions .getAllowNonRestoredState ())));
97+ String savePointPath = confProperties .getProperty (ConfigConstrant .SAVE_POINT_PATH_KEY );
98+ if (StringUtils .isNotBlank (savePointPath )){
99+ String allowNonRestoredState = confProperties .getOrDefault (ConfigConstrant .ALLOW_NON_RESTORED_STATE_KEY , "false" ).toString ();
100+ program .setSavepointRestoreSettings (SavepointRestoreSettings .forPath (savePointPath , BooleanUtils .toBoolean (allowNonRestoredState )));
91101 }
92102
93103 if (mode .equals (ClusterMode .yarnPer .name ())){
0 commit comments