public int setEnvironmentVariable(String name, String value) throws ExecutorException, CommandHandlerException {
    name = name.toLowerCase();
    if (name.equals(CliConstants.CONFIG_EXECUTOR)) {
      createShellExecutor(value);
      activeExecutorClassName = value;
      executorEnvHandler = executor.getEnvironmentVariableHandler();
      return 0;
    }

    if (name.equals(CliConstants.CONFIG_COMMAND_HANDLER)) {
      List<String> commandHandlersNames = Arrays.asList(value.split(","));
      for (String commandHandlerName : commandHandlersNames) {
        createCommandHandler(commandHandlerName.trim());
      }
      return 0;
    }

    EnvironmentVariableHandler handler = getAppropriateHandler(name);
    if (handler == null) {
      // Shell doesn't recognize this variable. There's no executor handler yet. Save for future executor
      if (delayedExecutorVars == null) {
        delayedExecutorVars = new HashMap<>();
      }
      delayedExecutorVars.put(name, value);
      return 0;
    }

    return handler.setEnvironmentVariable(name, value);
  }
Sets the value of an environment variable.
@param name Environment variable name
@param value Value of the environment variable
@return 0 : succeed
@throws ExecutorException When user sets an executor but not being able to create
@throws CommandHandlerException When user sets a CommandHandler but was not created successfully
-1: invalid name
-2: invalid value
samza-sql-shell/src/main/java/org/apache/samza/sql/client/cli/CliEnvironment.java