Abstract codec lookup by name, to make CodecService extensible#111007
Abstract codec lookup by name, to make CodecService extensible#111007ldematte merged 6 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
|
||
| import org.apache.lucene.codecs.Codec; | ||
|
|
||
| public class FilterCodecService implements CodecSupplier { |
There was a problem hiding this comment.
This is not strictly needed here, it will be used by extending code, but thought it would be nice to have (mimicking the various Filter* implementations in Lucene). But I'm OK to remove it if you think it does not belong here.
There was a problem hiding this comment.
Given this could be just a lambda, I'd suggest to remove it from ES. But no strong opinion on this.
| * @return the {@link CodecSupplier} | ||
| */ | ||
| public CodecService getCodecService() { | ||
| public CodecSupplier getCodecService() { |
There was a problem hiding this comment.
This could/should be renamed, but wanted to check with reviewers names were good (e.g. CodecSupplier) before doing it. Wdyt?
There was a problem hiding this comment.
yes, I think it should be renamed unless it touches a million places. Is it going to break the serverless build if renaming?
There was a problem hiding this comment.
I don't think so, but I'll try (add the label)
server/src/main/java/org/elasticsearch/index/codec/CodecSupplier.java
Outdated
Show resolved
Hide resolved
mosche
left a comment
There was a problem hiding this comment.
A minor suggestion on the name, but I prefer this approach 👍
lgtm
server/src/main/java/org/elasticsearch/index/codec/CodecProvided.java
Outdated
Show resolved
Hide resolved
* main: (39 commits) Update README.asciidoc (elastic#111244) ESQL: INLINESTATS (elastic#109583) ESQL: Document a little of `DataType` (elastic#111250) Relax assertions in segment level field stats (elastic#111243) LogsDB data generator - support nested object field (elastic#111206) Validate `Authorization` header in Azure test fixture (elastic#111242) Fixing HistoryStoreTests.testPut() and testStoreWithHideSecrets() (elastic#111246) [ESQL] Remove Named Expcted Types map from testing infrastructure (elastic#111213) Change visibility of createWriter to allow tests from a different package to override it (elastic#111234) [ES|QL] Remove EsqlDataTypes (elastic#111089) Mute org.elasticsearch.repositories.azure.AzureBlobContainerRetriesTests testReadNonexistentBlobThrowsNoSuchFileException elastic#111233 Abstract codec lookup by name, to make CodecService extensible (elastic#111007) Add HTTPS support to `AzureHttpFixture` (elastic#111228) Unmuting tests related to free_context action being processed in ESSingleNodeTestCase (elastic#111224) Upgrade Azure SDK (elastic#111225) Collapse transport versions for 8.14.0 (elastic#111199) Make sure contender uses logs templates (elastic#111183) unmute HistogramPercentileAggregationTests.testBoxplotHistogram (elastic#111223) Refactor Quality Assurance test infrastructure (elastic#111195) Mute org.elasticsearch.xpack.restart.FullClusterRestartIT testDisableFieldNameField {cluster=UPGRADED} elastic#111222 ... # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
This is the minimal change we can make to make it possible for use to provide a custom Codec/DocValuesFormat when using it via
EngineConfigin aEnginePlugin'sEngineFactory(basically this is just a "extract interface" here).An alternative (implemented here - main...ldematte/internal-engine-change) is to make
InternalEngine#getIndexWriterConfigextensible (protected); I think this one is cleaner and more in line with existing code (e.g. to use a custom Lucene MergePolicy we also make it changeable viaEngineFactory), but I'm fine either way.