当前位置: 首页>>代码示例>>Java>>正文


Java PluginsService类代码示例

本文整理汇总了Java中org.elasticsearch.plugins.PluginsService的典型用法代码示例。如果您正苦于以下问题:Java PluginsService类的具体用法?Java PluginsService怎么用?Java PluginsService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PluginsService类属于org.elasticsearch.plugins包,在下文中一共展示了PluginsService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: NodeService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
NodeService(Settings settings, ThreadPool threadPool, MonitorService monitorService, Discovery discovery,
                   TransportService transportService, IndicesService indicesService, PluginsService pluginService,
                   CircuitBreakerService circuitBreakerService, ScriptService scriptService,
                   @Nullable HttpServerTransport httpServerTransport, IngestService ingestService, ClusterService clusterService,
                   SettingsFilter settingsFilter) {
    super(settings);
    this.threadPool = threadPool;
    this.monitorService = monitorService;
    this.transportService = transportService;
    this.indicesService = indicesService;
    this.discovery = discovery;
    this.pluginService = pluginService;
    this.circuitBreakerService = circuitBreakerService;
    this.httpServerTransport = httpServerTransport;
    this.ingestService = ingestService;
    this.settingsFilter = settingsFilter;
    this.scriptService = scriptService;
    clusterService.addStateApplier(ingestService.getPipelineStore());
    clusterService.addStateApplier(ingestService.getPipelineExecutionService());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:NodeService.java

示例2: buildClient

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Override
protected Client buildClient(Settings headersSettings, GenericAction[] testedActions) {
    transportService = MockTransportService.createNewService(Settings.EMPTY, Version.CURRENT, threadPool, null);
    transportService.start();
    transportService.acceptIncomingRequests();
    TransportClient client = new MockTransportClient(Settings.builder()
            .put("client.transport.sniff", false)
            .put("cluster.name", "cluster1")
            .put("node.name", "transport_client_" + this.getTestName())
            .put(headersSettings)
            .build(), InternalTransportServiceInterceptor.TestPlugin.class);
    InternalTransportServiceInterceptor.TestPlugin plugin = client.injector.getInstance(PluginsService.class)
        .filterPlugins(InternalTransportServiceInterceptor.TestPlugin.class).stream().findFirst().get();
    plugin.instance.threadPool = client.threadPool();
    plugin.instance.address = transportService.boundAddress().publishAddress();
    client.addTransportAddress(transportService.boundAddress().publishAddress());
    return client;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:TransportClientHeadersTests.java

示例3: testWithSniffing

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
public void testWithSniffing() throws Exception {
    try (TransportClient client = new MockTransportClient(
            Settings.builder()
                    .put("client.transport.sniff", true)
                    .put("cluster.name", "cluster1")
                    .put("node.name", "transport_client_" + this.getTestName() + "_1")
                    .put("client.transport.nodes_sampler_interval", "1s")
                    .put(HEADER_SETTINGS)
                    .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir().toString()).build(),
            InternalTransportServiceInterceptor.TestPlugin.class)) {
        InternalTransportServiceInterceptor.TestPlugin plugin = client.injector.getInstance(PluginsService.class)
            .filterPlugins(InternalTransportServiceInterceptor.TestPlugin.class).stream().findFirst().get();
        plugin.instance.threadPool = client.threadPool();
        plugin.instance.address = transportService.boundAddress().publishAddress();
        client.addTransportAddress(transportService.boundAddress().publishAddress());

        if (!plugin.instance.clusterStateLatch.await(5, TimeUnit.SECONDS)) {
            fail("takes way too long to get the cluster state");
        }

        assertEquals(1, client.connectedNodes().size());
        assertEquals(client.connectedNodes().get(0).getAddress(), transportService.boundAddress().publishAddress());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:TransportClientHeadersTests.java

示例4: NodeService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Inject
public NodeService(Settings settings, ThreadPool threadPool, MonitorService monitorService, Discovery discovery,
                   TransportService transportService, IndicesService indicesService,
                   PluginsService pluginService, CircuitBreakerService circuitBreakerService,
                   Version version) {
    super(settings);
    this.threadPool = threadPool;
    this.monitorService = monitorService;
    this.transportService = transportService;
    this.indicesService = indicesService;
    this.discovery = discovery;
    discovery.setNodeService(this);
    this.version = version;
    this.pluginService = pluginService;
    this.circuitBreakerService = circuitBreakerService;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:NodeService.java

示例5: IndicesService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
public IndicesService(Settings settings, PluginsService pluginsService, NodeEnvironment nodeEnv, NamedXContentRegistry xContentRegistry,
                      ClusterSettings clusterSettings, AnalysisRegistry analysisRegistry,
                      IndexNameExpressionResolver indexNameExpressionResolver,
                      MapperRegistry mapperRegistry, NamedWriteableRegistry namedWriteableRegistry,
                      ThreadPool threadPool, IndexScopedSettings indexScopedSettings, CircuitBreakerService circuitBreakerService,
                      BigArrays bigArrays, ScriptService scriptService, ClusterService clusterService, Client client,
                      MetaStateService metaStateService) {
    super(settings);
    this.threadPool = threadPool;
    this.pluginsService = pluginsService;
    this.nodeEnv = nodeEnv;
    this.xContentRegistry = xContentRegistry;
    this.shardsClosedTimeout = settings.getAsTime(INDICES_SHARDS_CLOSED_TIMEOUT, new TimeValue(1, TimeUnit.DAYS));
    this.analysisRegistry = analysisRegistry;
    this.indexNameExpressionResolver = indexNameExpressionResolver;
    this.indicesRequestCache = new IndicesRequestCache(settings);
    this.indicesQueryCache = new IndicesQueryCache(settings);
    this.mapperRegistry = mapperRegistry;
    this.namedWriteableRegistry = namedWriteableRegistry;
    indexingMemoryController = new IndexingMemoryController(settings, threadPool,
                                                            // ensure we pull an iter with new shards - flatten makes a copy
                                                            () -> Iterables.flatten(this).iterator());
    this.indexScopeSetting = indexScopedSettings;
    this.circuitBreakerService = circuitBreakerService;
    this.bigArrays = bigArrays;
    this.scriptService = scriptService;
    this.clusterService = clusterService;
    this.client = client;
    this.indicesFieldDataCache = new IndicesFieldDataCache(settings, new IndexFieldDataCache.Listener() {
        @Override
        public void onRemoval(ShardId shardId, String fieldName, boolean wasEvicted, long sizeInBytes) {
            assert sizeInBytes >= 0 : "When reducing circuit breaker, it should be adjusted with a number higher or equal to 0 and not [" + sizeInBytes + "]";
            circuitBreakerService.getBreaker(CircuitBreaker.FIELDDATA).addWithoutBreaking(-sizeInBytes);
        }
    });
    this.cleanInterval = INDICES_CACHE_CLEAN_INTERVAL_SETTING.get(settings);
    this.cacheCleaner = new CacheCleaner(indicesFieldDataCache, indicesRequestCache,  logger, threadPool, this.cleanInterval);
    this.metaStateService = metaStateService;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:40,代码来源:IndicesService.java

示例6: newPluginService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private static PluginsService newPluginService(final Settings settings, Collection<Class<? extends Plugin>> plugins) {
    final Settings.Builder settingsBuilder = Settings.builder()
            .put(TcpTransport.PING_SCHEDULE.getKey(), "5s") // enable by default the transport schedule ping interval
            .put(InternalSettingsPreparer.prepareSettings(settings))
            .put(NetworkService.NETWORK_SERVER.getKey(), false)
            .put(CLIENT_TYPE_SETTING_S.getKey(), CLIENT_TYPE);
    return new PluginsService(settingsBuilder.build(), null, null, plugins);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:TransportClient.java

示例7: initBlockFactory

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private List<ScriptedBlockPlugin> initBlockFactory() {
    List<ScriptedBlockPlugin> plugins = new ArrayList<>();
    for (PluginsService pluginsService : internalCluster().getDataNodeInstances(PluginsService.class)) {
        plugins.addAll(pluginsService.filterPlugins(ScriptedBlockPlugin.class));
    }
    for (ScriptedBlockPlugin plugin : plugins) {
        plugin.scriptedBlockFactory.reset();
        plugin.scriptedBlockFactory.enableBlock();
    }
    return plugins;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:SearchCancellationIT.java

示例8: assertAllRequestsHaveBeenConsumed

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private static void assertAllRequestsHaveBeenConsumed() {
    Iterable<PluginsService> pluginsServices = internalCluster().getInstances(PluginsService.class);
    for (PluginsService pluginsService : pluginsServices) {
        Set<Map.Entry<String, List<TransportRequest>>> entries =
            pluginsService.filterPlugins(InterceptingTransportService.TestPlugin.class).stream().findFirst().get()
            .instance.requests.entrySet();
        assertThat(entries, emptyIterable());

    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:IndicesRequestIT.java

示例9: clearInterceptedActions

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private static void clearInterceptedActions() {
    Iterable<PluginsService> pluginsServices = internalCluster().getInstances(PluginsService.class);
    for (PluginsService pluginsService : pluginsServices) {
        pluginsService.filterPlugins(InterceptingTransportService.TestPlugin.class).stream().findFirst().get()
            .instance.clearInterceptedActions();
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:IndicesRequestIT.java

示例10: interceptTransportActions

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private static void interceptTransportActions(String... actions) {
    Iterable<PluginsService> pluginsServices = internalCluster().getInstances(PluginsService.class);
    for (PluginsService pluginsService : pluginsServices) {
        pluginsService.filterPlugins(InterceptingTransportService.TestPlugin.class).stream().findFirst().get()
            .instance.interceptTransportActions(actions);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:IndicesRequestIT.java

示例11: consumeTransportRequests

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
private static List<TransportRequest> consumeTransportRequests(String action) {
    List<TransportRequest> requests = new ArrayList<>();

    Iterable<PluginsService> pluginsServices = internalCluster().getInstances(PluginsService.class);
    for (PluginsService pluginsService : pluginsServices) {
        List<TransportRequest> transportRequests = pluginsService.filterPlugins(InterceptingTransportService.TestPlugin.class)
            .stream().findFirst().get().instance.consumeRequests(action);
        if (transportRequests != null) {
            requests.addAll(transportRequests);
        }
    }
    return requests;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:IndicesRequestIT.java

示例12: IndicesService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Inject
public IndicesService(Settings settings, IndicesLifecycle indicesLifecycle, IndicesAnalysisService indicesAnalysisService, Injector injector, NodeEnvironment nodeEnv) {
    super(settings);
    this.indicesLifecycle = (InternalIndicesLifecycle) indicesLifecycle;
    this.indicesAnalysisService = indicesAnalysisService;
    this.injector = injector;
    this.pluginsService = injector.getInstance(PluginsService.class);
    this.indicesLifecycle.addListener(oldShardsStats);
    this.nodeEnv = nodeEnv;
    this.shardsClosedTimeout = settings.getAsTime(INDICES_SHARDS_CLOSED_TIMEOUT, new TimeValue(1, TimeUnit.DAYS));
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:IndicesService.java

示例13: IndexService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Inject
public IndexService(Injector injector, Index index, NodeEnvironment nodeEnv,
                    AnalysisService analysisService, MapperService mapperService, IndexQueryParserService queryParserService,
                    SimilarityService similarityService, IndexAliasesService aliasesService, IndexCache indexCache,
                    IndexSettingsService settingsService,
                    IndexFieldDataService indexFieldData, BitsetFilterCache bitSetFilterCache, IndicesService indicesServices) {

    super(index, settingsService.getSettings());
    this.injector = injector;
    this.analysisService = analysisService;
    this.mapperService = mapperService;
    this.queryParserService = queryParserService;
    this.similarityService = similarityService;
    this.aliasesService = aliasesService;
    this.indexCache = indexCache;
    this.indexFieldData = indexFieldData;
    this.settingsService = settingsService;
    this.bitsetFilterCache = bitSetFilterCache;

    this.pluginsService = injector.getInstance(PluginsService.class);
    this.indicesServices = indicesServices;
    this.indicesLifecycle = (InternalIndicesLifecycle) injector.getInstance(IndicesLifecycle.class);

    // inject workarounds for cyclic dep
    indexFieldData.setListener(new FieldDataCacheListener(this));
    bitSetFilterCache.setListener(new BitsetCacheListener(this));
    this.nodeEnv = nodeEnv;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:29,代码来源:IndexService.java

示例14: FessAnalysisService

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Inject
public FessAnalysisService(final Settings settings, final PluginsService pluginsService,
        final FessAnalysisPlugin.PluginComponent pluginComponent) {
    super(settings);
    this.pluginsService = pluginsService;
    pluginComponent.setFessAnalysisService(this);
}
 
开发者ID:codelibs,项目名称:elasticsearch-analysis-fess,代码行数:8,代码来源:FessAnalysisService.java

示例15: nodeSettings

import org.elasticsearch.plugins.PluginsService; //导入依赖的package包/类
@Override
protected Settings nodeSettings(final int nodeOrdinal) {
    return ImmutableSettings.settingsBuilder().put(super.nodeSettings(nodeOrdinal)).put("gateway.type", "none")
            .put("plugins." + PluginsService.LOAD_PLUGIN_FROM_CLASSPATH, true).put("script.disable_dynamic", false)
            //.put("node.local", false)
            .put("http.cors.enabled", true).put("http.enabled", true).build();
}
 
开发者ID:salyh,项目名称:elasticsearch-sample-plugin-audit,代码行数:8,代码来源:AbstractUnitTest.java


注:本文中的org.elasticsearch.plugins.PluginsService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。