public PluginUsingNode(final Settings preparedSettings, Collection<Class<? extends Plugin>> plugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, plugins); } }
/** * Prepares the settings by gathering all elasticsearch system properties and setting defaults. */ public static Settings prepareSettings(Settings input) { Settings.Builder output = settingsBuilder(); initializeSettings(output, input, true); finalizeSettings(output, null, null); return output.build(); }
protected AbstractClient(Settings pSettings, boolean loadConfigSettings) { Tuple<Settings, Environment> tuple = InternalSettingsPreparer.prepareSettings(pSettings, loadConfigSettings); Settings settings = settingsBuilder().put(tuple.v1()) .put("network.server", false) .put("node.client", true) .build(); this.environment = tuple.v2(); this.pluginsService = new PluginsService(settings, tuple.v2()); this.settings = pluginsService.updatedSettings(); Version version = Version.CURRENT; CompressorFactory.configure(this.settings); ModulesBuilder modules = new ModulesBuilder(); modules.add(new SettingsModule(this.settings)); modules.add(new ThreadPoolModule(this.settings)); this.injector = modules.createInjector(); }
replacePromptPlaceholders(output, terminal); String name = output.get("node.name"); if (name == null || name.isEmpty()) { name = randomNodeName(configDir);
String secretValue = promptForValue(setting, terminal, true); if (Strings.hasLength(secretValue)) { settings.put(setting, secretValue); String textValue = promptForValue(setting, terminal, false); if (Strings.hasLength(textValue)) { settings.put(setting, textValue);
Settings settings = InternalSettingsPreparer.prepareSettings(this.settings); settings = settingsBuilder() .put(NettyTransport.PING_SCHEDULE, "5s") // enable by default the transport schedule ping interval
private static Environment initialSettings(boolean foreground) { Terminal terminal = foreground ? Terminal.DEFAULT : null; return InternalSettingsPreparer.prepareEnvironment(EMPTY_SETTINGS, terminal); }
public InternalNode(Settings pSettings, boolean loadConfigSettings) throws ElasticsearchException { Tuple<Settings, Environment> tuple = InternalSettingsPreparer.prepareSettings(pSettings, loadConfigSettings); tuple = new Tuple<>(TribeService.processSettings(tuple.v1()), tuple.v2());
initializeSettings(output, input, true); Environment environment = new Environment(output.build()); boolean settingsFileFound = false; initializeSettings(output, input, false); finalizeSettings(output, terminal, environment.configFile());
public PluginAwareNode(final Settings preparedSettings, final Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, classpathPlugins); } }
/** * Constructs a node with the given settings. * * @param preparedSettings Base settings to configure the node with */ public Node(Settings preparedSettings) { this(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, Collections.<Class<? extends Plugin>>emptyList()); }
PluginNode(final Settings settings) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), PLUGINS); } }
PluginNode(final Settings settings) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), PLUGINS); } }
protected CliTool(CliToolConfig config, Terminal terminal) { Preconditions.checkArgument(config.cmds().size() != 0, "At least one command must be configured"); this.config = config; this.terminal = terminal; env = InternalSettingsPreparer.prepareEnvironment(EMPTY_SETTINGS, terminal); settings = env.settings(); }
public static void main(String[] args) { // initialize default for es.logger.level because we will not read the logging.yml String loggerLevel = System.getProperty("es.logger.level", "INFO"); // Set the appender for all potential log files to terminal so that other components that use the logger print out the // same terminal. // The reason for this is that the plugin cli cannot be configured with a file appender because when the plugin command is // executed there is no way of knowing where the logfiles should be placed. For example, if elasticsearch // is run as service then the logs should be at /var/log/elasticsearch but when started from the tar they should be at es.home/logs. // Therefore we print to Terminal. Environment env = InternalSettingsPreparer.prepareEnvironment(Settings.builder() .put("appender.terminal.type", "terminal") .put("rootLogger", "${es.logger.level}, terminal") .put("es.logger.level", loggerLevel) .build(), Terminal.DEFAULT); // configure but do not read the logging conf file LogConfigurator.configure(env.settings(), false); int status = new PluginManagerCliParser().execute(args).status(); exit(status); }