Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSearch: do not install or load unused plugins #855

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions app/opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,30 @@ sourceSets {
}

dependencies {
implementation 'org.opensearch.client:opensearch-java:2.16.0'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.0'
implementation 'org.opensearch.client:opensearch-java:2.18.0'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.4.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'

implementation 'org.codelibs.opensearch:opensearch-runner:2.17.1.0'
implementation('org.codelibs.opensearch:opensearch-runner:2.18.0.0') {
exclude(module: 'repository-url')
exclude(module: 'reindex-client')
exclude(module: 'rank-eval-client')
exclude(module: 'percolator-client')
exclude(module: 'parent-join-client')
exclude(module: 'mapper-extras-client')
exclude(module: 'opensearch-scripting-painless-spi')
exclude(module: 'lang-painless')
exclude(module: 'lang-mustache-client')
exclude(module: 'lang-expression')
exclude(module: 'ingest-user-agent')
exclude(module: 'ingest-common')
exclude(module: 'aggs-matrix-stats-client')
exclude(module: 'lucene-grouping')
}

// updates for indirect dependencies
implementation 'io.netty:netty-codec:4.1.114.Final'
implementation 'io.netty:netty-codec-http:4.1.114.Final'
implementation 'io.netty:netty-codec:4.1.115.Final'
implementation 'io.netty:netty-codec-http:4.1.115.Final'
}

tasks.named('jar') {
Expand Down
11 changes: 10 additions & 1 deletion app/opensearch/src/main/java/de/komoot/photon/Server.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ public class Server {

private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(Server.class);

public static final String OPENSEARCH_MODULES =
"org.opensearch.transport.Netty4Plugin,"
+ "org.opensearch.analysis.common.CommonAnalysisPlugin";

protected OpenSearchClient client;
private OpenSearchRunner runner = null;
protected final String dataDirectory;
Expand Down Expand Up @@ -78,7 +82,12 @@ private HttpHost[] startInternal(String clusterName) {
settingsBuilder.put("discovery.type", "single-node");
settingsBuilder.putList("discovery.seed_hosts", "127.0.0.1:9201");
settingsBuilder.put("indices.query.bool.max_clause_count", "30000");
}).build(OpenSearchRunner.newConfigs().basePath(dataDirectory).clusterName(clusterName).numOfNode(1));
}).build(OpenSearchRunner.newConfigs()
.basePath(dataDirectory)
.clusterName(clusterName)
.numOfNode(1)
.moduleTypes(OPENSEARCH_MODULES)
);

runner.ensureYellow();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public void build(final int number, final Settings.Builder settingsBuilder) {
settingsBuilder.put("cluster.search.request.slowlog.threshold.trace", "0ms");

}
}).build(OpenSearchRunner.newConfigs().basePath(instanceDir).clusterName(clusterName).numOfNode(1).baseHttpPort(9200));
}).build(OpenSearchRunner.newConfigs()
.basePath(instanceDir)
.clusterName(clusterName)
.numOfNode(1)
.baseHttpPort(9200)
.moduleTypes(OPENSEARCH_MODULES));

// wait for yellow status
runner.ensureYellow();
Expand Down
Loading