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


Java Plugin类代码示例

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


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

示例1: processModule

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
public void processModule(Module module) {
    for (Plugin plugin : plugins) {
        // see if there are onModule references
        List<OnModuleReference> references = onModuleReferences.get(plugin);
        if (references != null) {
            for (OnModuleReference reference : references) {
                if (reference.moduleClass.isAssignableFrom(module.getClass())) {
                    try {
                        reference.onModuleMethod.invoke(plugin, module);
                    } catch (Exception e) {
                        logger.warn("plugin {}, failed to invoke custom onModule method", e, plugin.name());
                    }
                }
            }
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:CrateComponentLoader.java

示例2: getTypeKey

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
private static String getTypeKey(Class<? extends Plugin> clazz) {
    if (clazz.equals(MockTcpTransportPlugin.class)) {
        return MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME;
    } else {
        assert clazz.equals(Netty4Plugin.class);
        return Netty4Plugin.NETTY_TRANSPORT_NAME;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:HttpSmokeTestCase.java

示例3: addMockTransportIfMissing

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
private static Collection<Class<? extends Plugin>> addMockTransportIfMissing(Collection<Class<? extends Plugin>> plugins) {
    if (plugins.contains(MockTcpTransportPlugin.class)) {
        return plugins;
    }
    plugins = new ArrayList<>(plugins);
    plugins.add(MockTcpTransportPlugin.class);
    return plugins;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:MockTransportClient.java

示例4: getMockPlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
/** Return the mock plugins the cluster should use */
protected Collection<Class<? extends Plugin>> getMockPlugins() {
    final ArrayList<Class<? extends Plugin>> mocks = new ArrayList<>();
    if (randomBoolean()) { // sometimes run without those completely
        if (randomBoolean() && addMockTransportService()) {
            mocks.add(MockTransportService.TestPlugin.class);
        }
        if (randomBoolean()) {
            mocks.add(MockFSIndexStore.TestPlugin.class);
        }
        if (randomBoolean()) {
            mocks.add(NodeMocksPlugin.class);
        }
        if (randomBoolean()) {
            mocks.add(MockEngineFactoryPlugin.class);
        }
        if (randomBoolean()) {
            mocks.add(MockSearchService.TestPlugin.class);
        }
        if (randomBoolean()) {
            mocks.add(AssertingTransportInterceptor.TestPlugin.class);
        }
    }

    if (addMockTransportService()) {
        mocks.add(MockTcpTransportPlugin.class);
    }

    mocks.add(TestZenDiscovery.TestPlugin.class);
    mocks.add(TestSeedPlugin.class);
    return Collections.unmodifiableList(mocks);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:33,代码来源:ESIntegTestCase.java

示例5: testComponentsMockedByMarkerPlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
/**
 * Test that we add the appropriate mock services when their plugins are added. This is a very heavy test for a testing component but
 * we've broken it in the past so it is important.
 */
public void testComponentsMockedByMarkerPlugins() throws IOException {
    Settings settings = Settings.builder() // All these are required or MockNode will fail to build.
            .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir())
            .put("transport.type", MockTcpTransportPlugin.MOCK_TCP_TRANSPORT_NAME)
            .put("http.enabled", false)
            .build();
    List<Class<? extends Plugin>> plugins = new ArrayList<>();
    plugins.add(MockTcpTransportPlugin.class);
    boolean useMockBigArrays = randomBoolean();
    boolean useMockSearchService = randomBoolean();
    if (useMockBigArrays) {
        plugins.add(NodeMocksPlugin.class);
    }
    if (useMockSearchService) {
        plugins.add(MockSearchService.TestPlugin.class);
    }
    try (MockNode node = new MockNode(settings, plugins)) {
        BigArrays bigArrays = node.injector().getInstance(BigArrays.class);
        SearchService searchService = node.injector().getInstance(SearchService.class);
        if (useMockBigArrays) {
            assertSame(bigArrays.getClass(), MockBigArrays.class);
        } else {
            assertSame(bigArrays.getClass(), BigArrays.class);
        }
        if (useMockSearchService) {
            assertSame(searchService.getClass(), MockSearchService.class);
        } else {
            assertSame(searchService.getClass(), SearchService.class);
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:36,代码来源:MockNodeTests.java

示例6: addPlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
protected static Collection<Class<? extends Plugin>> addPlugins(Collection<Class<? extends Plugin>> collection,
        Collection<Class<? extends Plugin>> plugins) {
    ArrayList<Class<? extends Plugin>> list = new ArrayList<>(collection);
    for (Class<? extends Plugin> p : plugins) {
        if (list.contains(p)) {
            throw new IllegalArgumentException("plugin already exists: " + p);
        }
        list.add(p);
    }
    return list;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:TransportClient.java

示例7: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    ArrayList<Class<? extends Plugin>> plugins = new ArrayList<>();
    plugins.addAll(getMockPlugins());
    plugins.add(TestCustomMetaDataPlugin.class);
    return plugins;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TribeIT.java

示例8: startRemoteClusters

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Before
public void startRemoteClusters() {
    final int minNumDataNodes = 2;
    final int maxNumDataNodes = 4;
    final NodeConfigurationSource nodeConfigurationSource = getNodeConfigSource();
    final Collection<Class<? extends Plugin>> plugins = nodePlugins();

    if (cluster1 == null) {
        cluster1 = new InternalTestCluster(randomLong(), createTempDir(), true, true, minNumDataNodes, maxNumDataNodes,
                UUIDs.randomBase64UUID(random()), nodeConfigurationSource, 0, false, "cluster_1",
                plugins, Function.identity());
    }

    if (cluster2 == null) {
        cluster2 = new InternalTestCluster(randomLong(), createTempDir(), true, true, minNumDataNodes, maxNumDataNodes,
                UUIDs.randomBase64UUID(random()), nodeConfigurationSource, 0, false, "cluster_2",
                plugins, Function.identity());
    }

    doWithAllClusters(c -> {
        try {
            c.beforeTest(random(), 0.1);
            c.ensureAtLeastNumDataNodes(minNumDataNodes);
        } catch (Exception e) {
            throw new RuntimeException("Failed to set up remote cluster [" + c.getClusterName() + "]", e);
        }
    });
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:TribeIT.java

示例9: nodeServices

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
public Collection<Class<? extends LifecycleComponent>> nodeServices() {
    List<Class<? extends LifecycleComponent>> services = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        services.addAll(plugin.nodeServices());
    }
    return services;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:CrateComponentLoader.java

示例10: shardModules

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
public Collection<Module> shardModules(Settings indexSettings) {
    List<Module> modules = Lists.newArrayList();
    for (Plugin plugin : plugins) {
        modules.addAll(plugin.shardModules(indexSettings));
    }
    return modules;
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:CrateComponentLoader.java

示例11: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    return Collections.singleton(AnalysisOpenKoreanTextPlugin.class);
}
 
开发者ID:open-korean-text,项目名称:elasticsearch-analysis-openkoreantext,代码行数:5,代码来源:AnalysisOpenKoreanTextPluginTest.java

示例12: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    return Collections.singleton(ExpressionPlugin.class);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:StoredExpressionTests.java

示例13: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    return Arrays.asList(InternalSettingsPlugin.class); // uses index.merge.enabled
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:IpFieldBwCompatIT.java

示例14: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    // Use the mock internal cluster info service, which has fake-able disk usages
    return Arrays.asList(MockInternalClusterInfoService.TestPlugin.class);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:MockDiskUsagesIT.java

示例15: nodePlugins

import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
    return Arrays.asList(MockFSIndexStore.TestPlugin.class);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:SearchWithRandomIOExceptionsIT.java


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