opensearch-project / custom-codecs

OpenSearch custom lucene codecs for providing different on-disk index encoding (e.g., compression).
Apache License 2.0
6 stars 13 forks source link

Accessors for custom compression modes #89

Closed sarthakaggarwal97 closed 6 months ago

sarthakaggarwal97 commented 7 months ago

Description

Enables accessors for custom compression modes.

Issues Resolved

88

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

sarthakaggarwal97 commented 7 months ago

@reta please take a look! Thank you :D I've added a test for the getters, however lmk if I should remove it. I think, in general, we don't need to test the getters/accessors.

reta commented 7 months ago

I've added a test for the getters, however lmk if I should remove it. I think, in general, we don't need to test the getters/accessors.

@sarthakaggarwal97 sure, what is the practical reason of exposing these properties?

sarthakaggarwal97 commented 7 months ago

@reta I'm working on a plugin which requires me to have my own implementation of the Lucene90CompressingStoredFieldsFormat to optimize on read operations. With this implementation, I would like to add support for ZstdCompressionMode and ZstdNoDictCompressionMode which requires me to pass them as arguments, and custom-codecs package would be able to provide the compression modes out of the box while avoiding any code/implementation duplication. I don't see any risks in exposing the compression modes via getters. Please lmk if you see any concerns.

reta commented 7 months ago

I don't see any risks in exposing the compression modes via getters. Please lmk if you see any concerns.

@sarthakaggarwal97 There are few issues here:

sarthakaggarwal97 commented 6 months ago

@reta yes, if we want to just fetch the compression mode, we should use the API you suggested. I've updated the PR to now return a map of compression modes against the respective Mode.