Skip to content

Commit f56b79c

Browse files
committed
Resolve comments
Signed-off-by: xuxiong1 <[email protected]>
1 parent 01750d3 commit f56b79c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
99
- Add temporal routing processors for time-based document routing ([#18920](https://github.com/opensearch-project/OpenSearch/issues/18920))
1010
- The dynamic mapping parameter supports false_allow_templates ([#19065](https://github.com/opensearch-project/OpenSearch/pull/19065))
1111
- Add a toBuilder method in EngineConfig to support easy modification of configs([#19054](https://github.com/opensearch-project/OpenSearch/pull/19054))
12+
- Add StoreFactory plugin interface for custom Store implementations([#19091](https://github.com/opensearch-project/OpenSearch/pull/19091))
1213

1314
### Changed
1415
- Add CompletionStage variants to methods in the Client Interface and default to ActionListener impl ([#18998](https://github.com/opensearch-project/OpenSearch/pull/18998))

server/src/main/java/org/opensearch/index/IndexModule.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public IndexModule(
311311
this.allowExpensiveQueries = allowExpensiveQueries;
312312
this.expressionResolver = expressionResolver;
313313
this.recoveryStateFactories = recoveryStateFactories;
314-
this.storeFactories = storeFactories == null ? Collections.emptyMap() : Collections.unmodifiableMap(storeFactories);
314+
this.storeFactories = storeFactories;
315315
this.fileCache = fileCache;
316316
this.compositeIndexSettings = compositeIndexSettings;
317317
}
@@ -880,14 +880,14 @@ private static IndexStorePlugin.StoreFactory resolveStoreFactory(
880880
final Map<String, IndexStorePlugin.StoreFactory> storeFactories
881881
) {
882882
final String key = indexSettings.getValue(INDEX_STORE_FACTORY_SETTING);
883-
if (key != null && key.isEmpty() == false) {
884-
final IndexStorePlugin.StoreFactory factory = storeFactories.get(key);
885-
if (factory == null) {
886-
throw new IllegalArgumentException("Unknown store factory [" + key + "]");
887-
}
888-
return factory;
883+
if (key == null || key.isEmpty()) {
884+
return Store::new;
889885
}
890-
return Store::new;
886+
final IndexStorePlugin.StoreFactory factory = storeFactories.get(key);
887+
if (factory == null) {
888+
throw new IllegalArgumentException("Unknown store factory [" + key + "]");
889+
}
890+
return factory;
891891
}
892892

893893
/**

server/src/main/java/org/opensearch/index/store/Store.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ public long getNumDocs() {
10821082
*
10831083
* @opensearch.api
10841084
*/
1085-
@PublicApi(since = "3.1.0")
1085+
@PublicApi(since = "3.2.0")
10861086
public static class LoadedMetadata {
10871087
public final Map<String, StoreFileMetadata> fileMetadata;
10881088
public final Map<String, String> userData;
@@ -1735,7 +1735,7 @@ public void markStoreCorrupted(IOException exception) throws IOException {
17351735
*
17361736
* @opensearch.api
17371737
*/
1738-
@PublicApi(since = "3.1.0")
1738+
@PublicApi(since = "3.2.0")
17391739
public interface OnClose extends Consumer<ShardLock> {
17401740
OnClose EMPTY = new OnClose() {
17411741
/**

0 commit comments

Comments
 (0)