本文整理汇总了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());
}
}
}
}
}
}
示例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;
}
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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;
}
示例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);
}
示例13: nodePlugins
import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(InternalSettingsPlugin.class); // uses index.merge.enabled
}
示例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);
}
示例15: nodePlugins
import org.elasticsearch.plugins.Plugin; //导入依赖的package包/类
@Override
protected Collection<Class<? extends Plugin>> nodePlugins() {
return Arrays.asList(MockFSIndexStore.TestPlugin.class);
}