Java Code Examples for org.elasticsearch.node.internal.InternalSettingsPreparer#prepareEnvironment()

The following examples show how to use org.elasticsearch.node.internal.InternalSettingsPreparer#prepareEnvironment() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PluginManagerCliParser.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
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);
}
 
Example 2
Source File: CliTool.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
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();
}
 
Example 3
Source File: EmbeddedElasticsearchNodeEnvironmentImpl.java    From Flink-CEPplus with Apache License 2.0 4 votes vote down vote up
public PluginNode(Settings settings) {
	super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty3Plugin.class));
}
 
Example 4
Source File: EmbeddedElasticsearchNodeEnvironmentImpl.java    From flink with Apache License 2.0 4 votes vote down vote up
public PluginNode(Settings settings) {
	super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty3Plugin.class));
}
 
Example 5
Source File: Bootstrap.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
private static Environment initialSettings(boolean foreground) {
    Terminal terminal = foreground ? Terminal.DEFAULT : null;
    return InternalSettingsPreparer.prepareEnvironment(EMPTY_SETTINGS, terminal);
}
 
Example 6
Source File: HadoopFormatIOElasticTest.java    From beam with Apache License 2.0 4 votes vote down vote up
PluginNode(final Settings settings) {
  super(InternalSettingsPreparer.prepareEnvironment(settings, null), PLUGINS);
}
 
Example 7
Source File: PluginUsingNode.java    From nexus-public with Eclipse Public License 1.0 4 votes vote down vote up
public PluginUsingNode(final Settings preparedSettings, Collection<Class<? extends Plugin>> plugins) {
  super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, plugins);
}
 
Example 8
Source File: PluginEnabledNode.java    From elasticsearch-shield-kerberos-realm with Apache License 2.0 4 votes vote down vote up
public PluginEnabledNode(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) {
    super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, classpathPlugins);
}
 
Example 9
Source File: MockNode.java    From elasticsearch-xml with Apache License 2.0 4 votes vote down vote up
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
    super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, classpathPlugins);
}
 
Example 10
Source File: PluginAwareNode.java    From elasticsearch-imap with Apache License 2.0 4 votes vote down vote up
public PluginAwareNode(final Settings preparedSettings, final Collection<Class<? extends Plugin>> classpathPlugins) {
    super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, classpathPlugins);
}
 
Example 11
Source File: MockNode.java    From elasticsearch-helper with Apache License 2.0 4 votes vote down vote up
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
    super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, classpathPlugins);
}
 
Example 12
Source File: MockNode.java    From elasticsearch-analysis-baseform with Apache License 2.0 4 votes vote down vote up
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
    super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, classpathPlugins);
}
 
Example 13
Source File: Node.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * 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());
}