@@ -119,7 +119,7 @@ public static void main(String[] args) throws Exception {
119119 clusterClientHelper .submit (jobDeployer );
120120 }
121121
122- private static void findDefaultConfigDir (Options launcherOptions ) {
122+ private static void findDefaultConfigDir (Options launcherOptions ) throws ClusterDeploymentException {
123123 findDefaultFlinkxDistDir (launcherOptions );
124124
125125 if (ClusterMode .local .name ().equalsIgnoreCase (launcherOptions .getMode ())) {
@@ -165,7 +165,7 @@ private static void findDefaultFlinkConf(Options launcherOptions) {
165165 }
166166 }
167167
168- private static void findDefaultFlinkxDistDir (Options launcherOptions ) {
168+ private static void findDefaultFlinkxDistDir (Options launcherOptions ) throws ClusterDeploymentException {
169169 String distDir = launcherOptions .getFlinkxDistDir ();
170170 if (StringUtils .isEmpty (distDir )) {
171171 String flinkxHome = getSystemProperty (KEY_FLINKX_HOME );
@@ -180,6 +180,9 @@ private static void findDefaultFlinkxDistDir(Options launcherOptions) {
180180 launcherOptions .setFlinkxDistDir (distDir );
181181 }
182182 }
183+ if (StringUtils .isEmpty (distDir )) {
184+ notConfiguredException (KEY_FLINKX_HOME );
185+ }
183186 System .setProperty (ConfigConstants .ENV_FLINK_PLUGINS_DIR , distDir );
184187 }
185188
@@ -191,4 +194,8 @@ private static String getSystemProperty(String name) {
191194
192195 return property ;
193196 }
197+
198+ private static void notConfiguredException (String propertyKey ) throws ClusterDeploymentException {
199+ throw new ClusterDeploymentException (propertyKey + " is not configured." );
200+ }
194201}
0 commit comments