🔎 Open source distributed and RESTful search engine.
Go to file
Kartik fb9e150076
Refactoring gated and ref-counted interfaces and their implementations (#2396)
* Reducing duplication in plugins around ref-counted releasable classes

Both AmazonEc2Reference and AmazonS3Reference duplicate the same logic - a subclass of AbstractRefCounted that also implements Releasable. This change centralizes this paradigm into a AbstractRefCountedReleasable class and supports both clients via generics. It also updates all fetching implementations to use the get() method instead of client()

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Introduce Reference classes for the Closeable and AutoCloseable interfaces

These classes allow you to wrap a reference instance with an onClose runnable that is executed when close() is invoked. Two separate classes are needed because the close() signatures for the two interfaces are different. This change takes the first step to have implementing classes extend from these generic superclasses, before attempting to remove the subclasses entirely. The get() method is also replaced throughout the code base.

Note that there is also a separate Releasable interface that has a similar access pattern, but is implemented separately. This is used in AbstractRefCountedReleasable introduced in a prior commit

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* More improvements and refactoring

* Functionality around one-way gating is now moved to a dedicated class - OneWayGate. This replaces duplicate functionality throughout the code.
* The two *Reference classes have been renamed to Gated* since that better represents their functionality
* The AbstractRefCountedReleasable has been improved to no longer be abstract by accepting the shutdown hook. This removes the need for the inner class in ReleasableBytesReference, and further simplifies the plugin subclasses (these could probably be removed entirely).
* Finally, unit tests have been added for some classes

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Added tests for GatedCloseable

Also updated the license information in GatedAutoCloseableTests

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Fixing license information in new files

Signed-off-by: Kartik Ganesh <gkart@amazon.com>

* Added unit tests for RefCountedReleasable

Signed-off-by: Kartik Ganesh <gkart@amazon.com>
2022-03-09 12:21:09 -08:00
.ci add 1.2.5 to bwcVersions 2022-02-04 15:10:18 -06:00
.github Remove Github DCO action since DCO runs via Github App now (#2317) 2022-03-03 10:39:27 -08:00
.idea Add IssueNavigationLink (#1964) 2022-01-27 09:04:03 -08:00
benchmarks Bump commons-math3 from 3.2 to 3.6.1 in /benchmarks (#2282) 2022-02-28 12:18:28 -08:00
buildSrc [Remove] TrimUnsafeCommit logic for legacy 6.x indexes (#2225) 2022-03-09 10:50:05 -08:00
client Set target and source compatibility to 11, required by Lucene 9. (#2407) 2022-03-08 14:48:51 -05:00
dev-tools Add script to perform signoff check between commits (#152) 2021-03-13 10:36:15 -06:00
distribution Set target and source compatibility to 11, required by Lucene 9. (#2407) 2022-03-08 14:48:51 -05:00
doc-tools Fixing .gitattributes for binary content, removing *.class files (#1717) 2021-12-13 15:02:42 -08:00
gradle Update FIPS API libraries of Bouncy Castle (#1853) 2022-01-05 16:59:55 -08:00
libs Refactoring gated and ref-counted interfaces and their implementations (#2396) 2022-03-09 12:21:09 -08:00
licenses Remove the Elastic license file, all checks for this license and the license REST APIs. (#12) 2021-03-13 10:36:07 -06:00
modules [Remove] include_type_name from HLRC (#2397) 2022-03-08 11:30:27 -06:00
plugins Refactoring gated and ref-counted interfaces and their implementations (#2396) 2022-03-09 12:21:09 -08:00
qa [Remove] TrimUnsafeCommit logic for legacy 6.x indexes (#2225) 2022-03-09 10:50:05 -08:00
release-notes Add release notes for 1.2.4 (#1934) 2022-01-18 16:23:11 -08:00
rest-api-spec Remove inclue_type_name parameter from rest api spec (#2410) 2022-03-08 14:43:04 -08:00
sandbox Enable adding experimental features through sandbox modules (#691) 2021-06-22 11:45:18 -05:00
server Refactoring gated and ref-counted interfaces and their implementations (#2396) 2022-03-09 12:21:09 -08:00
test Refactoring gated and ref-counted interfaces and their implementations (#2396) 2022-03-09 12:21:09 -08:00
.dir-locals.el Go back to 140 column limit in .dir-locals.el 2017-04-14 08:50:53 -06:00
.editorconfig Remove default indent from .editorconfig (#49183) 2019-11-18 08:05:53 +00:00
.gitattributes Updating .gitattributes for additional file types (#1727) 2021-12-17 16:09:34 -05:00
.gitignore Add IssueNavigationLink (#1964) 2022-01-27 09:04:03 -08:00
.lychee.excludes Upgrade and fix link checker to 1.2. (#1811) 2021-12-27 11:23:52 -06:00
.whitesource Change whitesource integration to scan on 1.x branch (#1786) 2022-01-03 17:49:09 -08:00
ADMINS.md Updated READMEs on releasing, maintaining, admins and security. (#853) 2021-06-17 18:03:11 -04:00
CODE_OF_CONDUCT.md Update CODE_OF_CONDUCT.md 2021-03-13 10:36:16 -06:00
CONTRIBUTING.md changed work-in-progress language (#1275) 2021-10-26 10:39:25 -07:00
DEVELOPER_GUIDE.md Set target and source compatibility to 11, required by Lucene 9. (#2407) 2022-03-08 14:48:51 -05:00
LICENSE.txt Update LICENSE.txt 2021-03-22 09:25:46 -05:00
MAINTAINERS.md Catching Maintainers up for Q4 2021 new additions/removals (#1841) 2022-01-04 08:33:50 -05:00
NOTICE.txt Fixed copyright to OpenSearch (#1175) 2021-08-31 12:55:28 -04:00
README.md Adding Security Reporting Instructions in README.md file Signed-off-by: Rishikesh Reddy Pasham rishireddy1159@gmail.com (#1326) 2021-10-02 10:41:30 -04:00
RELEASING.md Updated READMEs on releasing, maintaining, admins and security. (#853) 2021-06-17 18:03:11 -04:00
SECURITY.md Updated READMEs on releasing, maintaining, admins and security. (#853) 2021-06-17 18:03:11 -04:00
TESTING.md Replace exclusionary words whitelist and blacklist in the places that won't impact backwards compatibility (#2178) 2022-03-04 16:34:09 -08:00
Vagrantfile [FEATURE] Add OPENSEARCH_JAVA_HOME env to override JAVA_HOME (#2001) 2022-02-02 13:55:22 -05:00
build.gradle Set target and source compatibility to 11, required by Lucene 9. (#2407) 2022-03-08 14:48:51 -05:00
gradle.properties Adding support for JDK17 and removing JDK8 (#2025) 2022-02-02 20:59:10 -05:00
gradlew Update gradle wrapper to 6.6 (#59909) (#60949) 2020-08-11 11:03:19 +02:00
gradlew.bat Update gradle wrapper to 6.6 (#59909) (#60949) 2020-08-11 11:03:19 +02:00
settings.gradle Bump com.gradle.enterprise from 3.8 to 3.8.1 (#1920) 2022-01-18 10:46:18 -05:00
whitesource.config Change whitesource integration to scan on 1.x branch (#1786) 2022-01-03 17:49:09 -08:00

README.md

Welcome!

OpenSearch is a community-driven, open source fork of Elasticsearch and Kibana following the licence change in early 2021. We're looking to sustain (and evolve!) a search and analytics suite for the multitude of businesses who are dependent on the rights granted by the original, Apache v2.0 License.

Project Resources

Code of Conduct

This project has adopted the Amazon Open Source Code of Conduct. For more information see the Code of Conduct FAQ, or contact opensource-codeofconduct@amazon.com with any additional questions or comments.

Security

If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

License

This project is licensed under the Apache v2.0 License.

Copyright OpenSearch Contributors. See NOTICE for details.