forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MapperService has to be passed in as null for EnginePlugins CodecServ…
…ice constructor Signed-off-by: Andriy Redko <[email protected]>
- Loading branch information
Showing
6 changed files
with
186 additions
and
10 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
server/src/main/java/org/opensearch/index/codec/CodecServiceConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.index.codec; | ||
|
||
import org.opensearch.common.Nullable; | ||
import org.opensearch.index.IndexSettings; | ||
import org.opensearch.index.mapper.MapperService; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* The configuration parameters necessary for the {@link CodecService} instance construction. | ||
*/ | ||
public final class CodecServiceConfig { | ||
private final IndexSettings indexSettings; | ||
private final MapperService mapperService; | ||
|
||
public CodecServiceConfig(IndexSettings indexSettings, @Nullable MapperService mapperService) { | ||
this.indexSettings = Objects.requireNonNull(indexSettings); | ||
this.mapperService = mapperService; | ||
} | ||
|
||
public IndexSettings getIndexSettings() { | ||
return indexSettings; | ||
} | ||
|
||
@Nullable | ||
public MapperService getMapperService() { | ||
return mapperService; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
server/src/main/java/org/opensearch/index/codec/CodecServiceFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
package org.opensearch.index.codec; | ||
|
||
/** | ||
* A factory for creating new {@link CodecService} instance | ||
*/ | ||
@FunctionalInterface | ||
public interface CodecServiceFactory { | ||
/** | ||
* Create new {@link CodecService} instance | ||
* @param config code service configuration | ||
* @return new {@link CodecService} instance | ||
*/ | ||
CodecService createCodecService(CodecServiceConfig config); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters