Skip to content

Commit

Permalink
only use required modules
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Dec 3, 2024
1 parent 41be97b commit 6299b3b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
27 changes: 21 additions & 6 deletions app/opensearch/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,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 @@ -22,6 +22,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;
final protected String dataDirectory;
Expand Down Expand Up @@ -67,7 +71,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

0 comments on commit 6299b3b

Please sign in to comment.