Java Code Examples for org.elasticsearch.node.InternalSettingsPreparer#prepareEnvironment()
The following examples show how to use
org.elasticsearch.node.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: EmbeddedElasticsearchNode.java From immutables with Apache License 2.0 | 6 votes |
private LocalNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super( InternalSettingsPreparer.prepareEnvironment(settings, emptyMap(), null, () -> "default_node_name"), classpathPlugins, false); }
Example 2
Source File: NodeSettingsTest.java From crate with Apache License 2.0 | 6 votes |
@Before public void doSetup() throws Exception { tmp.create(); Path configPath = createConfigPath(); Map<String, String> settings = new HashMap<>(); settings.put("node.name", "node-test"); settings.put("node.data", "true"); settings.put(PATH_HOME_SETTING.getKey(), configPath.toString()); // Avoid connecting to other test nodes settings.put("discovery.type", "single-node"); Environment environment = InternalSettingsPreparer.prepareEnvironment(Settings.EMPTY, settings, configPath, () -> "node-test"); node = new CrateNode(environment); node.start(); sqlOperations = node.injector().getInstance(SQLOperations.class); }
Example 3
Source File: CrateDB.java From crate with Apache License 2.0 | 6 votes |
@Override protected Environment createEnv(Map<String, String> cmdLineSettings) throws UserException { // 1) Check that path.home is set on the command-line (mandatory) String crateHomePath = cmdLineSettings.get("path.home"); if (crateHomePath == null) { throw new IllegalArgumentException("Please set the environment variable CRATE_HOME or " + "use -Cpath.home on the command-line."); } // 2) Remove path.conf from command-line settings but use it as a conf path if exists // We need to remove it, because it was removed in ES6, but we want to keep the ability // to set it as CLI argument and keep backwards compatibility. String confPathCLI = cmdLineSettings.remove("path.conf"); final Path confPath; if (confPathCLI != null) { confPath = Paths.get(confPathCLI); } else { confPath = Paths.get(crateHomePath, "config"); } return InternalSettingsPreparer.prepareEnvironment(Settings.EMPTY, cmdLineSettings, confPath, NodeNames::randomNodeName); }
Example 4
Source File: EmbeddedElasticSearch.java From jetlinks-community with Apache License 2.0 | 5 votes |
@SneakyThrows public EmbeddedElasticSearch(EmbeddedElasticSearchProperties properties) { super(InternalSettingsPreparer.prepareEnvironment( properties.applySetting( Settings.builder() .put("node.name", "test") .put("discovery.type", "single-node") .put("transport.type", "netty4") .put("http.type", "netty4") .put("network.host", "0.0.0.0") .put("http.port", 9200) ).build(), null), Collections.singleton(Netty4Plugin.class), false); }
Example 5
Source File: EmbeddedElasticsearchNode.java From calcite with Apache License 2.0 | 5 votes |
private LocalNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super( InternalSettingsPreparer.prepareEnvironment(settings, emptyMap(), null, () -> "default_node_name"), classpathPlugins, false); }
Example 6
Source File: EnvironmentAwareCommand.java From crate with Apache License 2.0 | 5 votes |
/** Create an {@link Environment} for the command to use. Overrideable for tests. */ protected Environment createEnv(final Map<String, String> settings) throws UserException { String esPathConf = System.getProperty("es.path.conf"); if (esPathConf == null) { esPathConf = settings.get("path.conf"); } if (esPathConf == null) { throw new UserException(ExitCodes.CONFIG, "the system property [es.path.conf] must be set. Specify with -Cpath.conf=<path>"); } return InternalSettingsPreparer.prepareEnvironment(Settings.EMPTY, settings, getConfigPath(esPathConf), NodeNames::randomNodeName); }
Example 7
Source File: EmbeddedElasticSearchV6.java From conductor with Apache License 2.0 | 5 votes |
public PluginConfigurableNode(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins, false); }
Example 8
Source File: NodeExt.java From fast-elasticsearch-vector-scoring with Apache License 2.0 | 4 votes |
public NodeExt(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins); }
Example 9
Source File: EmbeddedElasticSearchV5.java From conductor with Apache License 2.0 | 4 votes |
public PluginConfigurableNode(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins); }
Example 10
Source File: ElasticsearchRestClientTest.java From java-specialagent with Apache License 2.0 | 4 votes |
public PluginConfigurableNode(final Settings settings, final Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); }
Example 11
Source File: EsEmbeddedServer.java From datashare with GNU Affero General Public License v3.0 | 4 votes |
public PluginConfigurableNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins, true); }
Example 12
Source File: EmbeddedElasticsearch5.java From baleen with Apache License 2.0 | 4 votes |
PluginConfigurableNode( Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); }
Example 13
Source File: ElasticsearchTransportClientTest.java From java-specialagent with Apache License 2.0 | 4 votes |
public PluginConfigurableNode(final Settings settings, final Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); }
Example 14
Source File: ElasticSearchComponent.java From metron with Apache License 2.0 | 4 votes |
private TestNode(Settings preparedSettings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), classpathPlugins); }
Example 15
Source File: EmbeddedElasticsearchNode.java From Quicksql with MIT License | 4 votes |
private LocalNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); }
Example 16
Source File: EmbeddedElasticsearchNode.java From Quicksql with MIT License | 4 votes |
private LocalNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins); }
Example 17
Source File: EmbeddedElasticsearchNodeEnvironmentImpl.java From flink with Apache License 2.0 | 4 votes |
public PluginNode(Settings settings) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty4Plugin.class)); }
Example 18
Source File: EmbeddedElasticsearchNodeEnvironmentImpl.java From flink with Apache License 2.0 | 4 votes |
public PluginNode(Settings settings) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty4Plugin.class)); }
Example 19
Source File: ElasticsearchServerServlet.java From wildfly-camel with Apache License 2.0 | 4 votes |
private static Environment prepareEnvironment(Settings preparedSettings) { Environment env = InternalSettingsPreparer.prepareEnvironment(preparedSettings, new HashMap<>(), null, defaultNodeName()); return env; }
Example 20
Source File: EmbeddedElasticsearchNodeEnvironmentImpl.java From Flink-CEPplus with Apache License 2.0 | 4 votes |
public PluginNode(Settings settings) { super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty4Plugin.class)); }