本文整理匯總了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);
}