本文整理汇总了Java中org.elasticsearch.node.internal.InternalSettingsPreparer类的典型用法代码示例。如果您正苦于以下问题:Java InternalSettingsPreparer类的具体用法?Java InternalSettingsPreparer怎么用?Java InternalSettingsPreparer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InternalSettingsPreparer类属于org.elasticsearch.node.internal包,在下文中一共展示了InternalSettingsPreparer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
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);
}
示例2: CliTool
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
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();
}
示例3: setup
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
private void setup(boolean addShutdownHook, Settings settings, Environment environment) throws Exception {
initializeNatives(environment.tmpFile(),
settings.getAsBoolean("bootstrap.mlockall", false),
settings.getAsBoolean("bootstrap.seccomp", true),
settings.getAsBoolean("bootstrap.ctrlhandler", true));
// initialize probes before the security manager is installed
initializeProbes();
if (addShutdownHook) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
if (node != null) {
node.close();
}
}
});
}
// look for jar hell
JarHell.checkJarHell();
// install SM after natives, shutdown hooks, etc.
setupSecurity(settings, environment);
// We do not need to reload system properties here as we have already applied them in building the settings and
// reloading could cause multiple prompts to the user for values if a system property was specified with a prompt
// placeholder
Settings nodeSettings = Settings.settingsBuilder()
.put(settings)
.put(InternalSettingsPreparer.IGNORE_SYSTEM_PROPERTIES_SETTING, true)
.build();
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().settings(nodeSettings);
node = nodeBuilder.build();
}
示例4: TestNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
TestNode(Settings settings) {
super(
InternalSettingsPreparer.prepareEnvironment(settings, null),
// To enable an http port in integration tests, the following plugin must be loaded.
Collections.singletonList(Netty4Plugin.class)
);
}
示例5: build
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
/**
* Builds a new instance of the transport client.
*/
public TransportClient build() {
Settings settings = InternalSettingsPreparer.prepareSettings(this.settings);
settings = settingsBuilder()
.put(NettyTransport.PING_SCHEDULE, "5s") // enable by default the transport schedule ping interval
.put(settings)
.put("network.server", false)
.put("node.client", true)
.put(CLIENT_TYPE_SETTING, CLIENT_TYPE)
.build();
PluginsService pluginsService = new PluginsService(settings, null, null, pluginClasses);
this.settings = pluginsService.updatedSettings();
Version version = Version.CURRENT;
final ThreadPool threadPool = new ThreadPool(settings);
NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry();
boolean success = false;
try {
ModulesBuilder modules = new ModulesBuilder();
modules.add(new Version.Module(version));
// plugin modules must be added here, before others or we can get crazy injection errors...
for (Module pluginModule : pluginsService.nodeModules()) {
modules.add(pluginModule);
}
modules.add(new PluginsModule(pluginsService));
modules.add(new SettingsModule(this.settings));
modules.add(new NetworkModule(namedWriteableRegistry));
modules.add(new ClusterNameModule(this.settings));
modules.add(new ThreadPoolModule(threadPool));
modules.add(new TransportModule(this.settings, namedWriteableRegistry));
modules.add(new SearchModule() {
@Override
protected void configure() {
// noop
}
});
modules.add(new ActionModule(true));
modules.add(new ClientTransportModule());
modules.add(new CircuitBreakerModule(this.settings));
pluginsService.processModules(modules);
Injector injector = modules.createInjector();
final TransportService transportService = injector.getInstance(TransportService.class);
transportService.start();
transportService.acceptIncomingRequests();
TransportClient transportClient = new TransportClient(injector);
success = true;
return transportClient;
} finally {
if (!success) {
ThreadPool.terminate(threadPool, 10, TimeUnit.SECONDS);
}
}
}
示例6: initialSettings
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
private static Environment initialSettings(boolean foreground) {
Terminal terminal = foreground ? Terminal.DEFAULT : null;
return InternalSettingsPreparer.prepareEnvironment(EMPTY_SETTINGS, terminal);
}
示例7: ElasticTestNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public ElasticTestNode(Settings setting, Collection<Class<? extends Plugin>> pluginPaths) {
super(InternalSettingsPreparer.prepareEnvironment(setting, null), Version.CURRENT, pluginPaths);
this.start();
}
示例8: MockNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), classpathPlugins);
}
示例9: PluginNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public PluginNode(final Settings settings) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), list);
}
示例10: MockNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public MockNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, classpathPlugins);
}
示例11: PluginConfigurableNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public PluginConfigurableNode(Settings settings, Collection<Class<? extends Plugin>> classpathPlugins) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, classpathPlugins);
}
示例12: PluginNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public PluginNode(Settings settings) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), Collections.<Class<? extends Plugin>>singletonList(Netty3Plugin.class));
}
示例13: MeshNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
protected MeshNode(Settings settings, Collection<Class<? extends Plugin>> plugins) {
super(InternalSettingsPreparer.prepareEnvironment(settings, null), Version.CURRENT, plugins);
}
示例14: PluginUsingNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public PluginUsingNode(final Settings preparedSettings, Collection<Class<? extends Plugin>> plugins) {
super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, plugins);
}
示例15: ArmorNode
import org.elasticsearch.node.internal.InternalSettingsPreparer; //导入依赖的package包/类
public ArmorNode(Settings preparedSettings, Collection<Class<? extends Plugin>> plugins) {
super(InternalSettingsPreparer.prepareEnvironment(preparedSettings, null), Version.CURRENT, plugins);
}