Search in sources :

Example 1 with CliException

use of org.apache.samza.sql.client.exceptions.CliException in project samza by apache.

the class CliEnvironment method finishInitialization.

/**
 * Gives CliEnvironment a chance to apply settings, especially during initialization, things like
 * making default values take effect
 */
public void finishInitialization() throws CliException {
    if (executor == null) {
        try {
            createShellExecutor(CliConstants.DEFAULT_EXECUTOR_CLASS);
            activeExecutorClassName = CliConstants.DEFAULT_EXECUTOR_CLASS;
            executorEnvHandler = executor.getEnvironmentVariableHandler();
            if (delayedExecutorVars != null) {
                for (Map.Entry<String, String> entry : delayedExecutorVars.entrySet()) {
                    setEnvironmentVariable(entry.getKey(), entry.getValue());
                }
                delayedExecutorVars = null;
            }
        } catch (ExecutorException | CommandHandlerException e) {
            // we have failed to create even the default executor thus not recoverable
            throw new CliException(e);
        }
    }
    finishInitialization(shellEnvHandler);
    finishInitialization(executorEnvHandler);
}
Also used : CommandHandlerException(org.apache.samza.sql.client.exceptions.CommandHandlerException) ExecutorException(org.apache.samza.sql.client.exceptions.ExecutorException) CliException(org.apache.samza.sql.client.exceptions.CliException) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 CliException (org.apache.samza.sql.client.exceptions.CliException)1 CommandHandlerException (org.apache.samza.sql.client.exceptions.CommandHandlerException)1 ExecutorException (org.apache.samza.sql.client.exceptions.ExecutorException)1