opensearch-project / OpenSearch

🔎 Open source distributed and RESTful search engine.
https://opensearch.org/docs/latest/opensearch/index/
Apache License 2.0
9.76k stars 1.82k forks source link

Opensearch Modularization #1838

Open rishabhmaurya opened 2 years ago

rishabhmaurya commented 2 years ago

Meta issue to track the progress of opensearch modularization.

reta commented 2 years ago

This is a large and disruptive one, I would recommend to start with cleaning up the packages since the same ones are scattered across many modules (so called split package issue). Probably the most challenging one is org.opensearch.client which is present in server, client:rest and client:rest-high-level, at least. I am sure there are more examples like that.

rishabhmaurya commented 2 years ago

solving split packages in org.opensearch.client and modularizing will surely unblock customers using java 9 modules and the rest high level client and is a good starting point. The overall goal is to split server module and allow plugin to depend on these sub modules instead of server module. This will ensure plugins to compile and run successfully, if there are no major version upgrade in its dependencies, on opensearch major version release. Also, the packages exported by modules will be controlled, so plugins cannot depend on classes not exported explicitly. This is a big step for overall hygiene and maintainability for both opensearch and its plugins.

Taking incremental steps is the right thing but we need to ensure all breaking changes go at once in OpenSearch 2.0, so that plugins incorporate all breaking changes only once. We need to start thinking on right modules to start with and mark them as automatic module while migrating packages to them from server module, fixing split packages and cyclic dependencies. Also, when there would be these sub-modules like org.opensearch.index or org.opensearch.analyzers etc, there would be even more split packages between these newly created modules and server module. Today, there are split packages between modules under lib and server module and also for org.apache.lucence between lucene modules and server module.

reta commented 2 years ago

@rishabhmaurya I think we should make this one a [META] issue since it also drags in other projects [1]

[1] https://github.com/opensearch-project/opensearch-java/issues/108