Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hotfix-744][client] fix directory is not configured NPE #780

Merged
merged 1 commit into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void main(String[] args) throws Exception {
clusterClientHelper.submit(jobDeployer);
}

private static void findDefaultConfigDir(Options launcherOptions) {
private static void findDefaultConfigDir(Options launcherOptions) throws ClusterDeploymentException {
findDefaultFlinkxDistDir(launcherOptions);

if (ClusterMode.local.name().equalsIgnoreCase(launcherOptions.getMode())) {
Expand Down Expand Up @@ -172,7 +172,7 @@ private static void findDefaultFlinkConf(Options launcherOptions) {
}
}

private static void findDefaultFlinkxDistDir(Options launcherOptions) {
private static void findDefaultFlinkxDistDir(Options launcherOptions) throws ClusterDeploymentException {
String distDir = launcherOptions.getFlinkxDistDir();
if (StringUtils.isEmpty(distDir)) {
String flinkxHome = getSystemProperty(KEY_FLINKX_HOME);
Expand All @@ -187,6 +187,9 @@ private static void findDefaultFlinkxDistDir(Options launcherOptions) {
launcherOptions.setFlinkxDistDir(distDir);
}
}
if (StringUtils.isEmpty(distDir)) {
notConfiguredException(KEY_FLINKX_HOME);
}
System.setProperty(ConfigConstants.ENV_FLINK_PLUGINS_DIR, distDir);
}

Expand All @@ -198,4 +201,8 @@ private static String getSystemProperty(String name) {

return property;
}

private static void notConfiguredException(String propertyKey) throws ClusterDeploymentException {
throw new ClusterDeploymentException(propertyKey + " is not configured.");
}
}