Throw an exception for invalid Spark Shell configuration.
@@ -91,10 +91,13 @@ public class SparkShellConfiguration {
@Qualifier("memoryLoginUsers") final Optional<Properties> users) {
if (sparkShellProperties.getServer() != null) {
return new ServerProcessManager(sparkShellProperties);
+ } else if (!users.isPresent()) {
+ throw new IllegalArgumentException("Invalid Spark configuration. Either set spark.shell.server.host and spark.shell.server.port in spark.properties or add the auth-memory Spring profile"
+ + " to application.properties.");
} else if (sparkShellProperties.isProxyUser()) {
- return new MultiUserProcessManager(sparkShellProperties, kerberosProperties, users.orElse(new Properties()));
+ return new MultiUserProcessManager(sparkShellProperties, kerberosProperties, users.get());
} else {
- return new DefaultProcessManager(sparkShellProperties, kerberosProperties, users.orElse(new Properties()));
+ return new DefaultProcessManager(sparkShellProperties, kerberosProperties, users.get());
}
}
