Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft] Implement getCustomCodecService for EnginePlugin #229

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions src/main/java/org/opensearch/knn/plugin/KNNEngineFactory.java

This file was deleted.

9 changes: 7 additions & 2 deletions src/main/java/org/opensearch/knn/plugin/KNNPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.opensearch.knn.plugin;

import org.opensearch.index.codec.CodecService;
import org.opensearch.knn.index.KNNCircuitBreaker;
import org.opensearch.knn.index.KNNQueryBuilder;
import org.opensearch.knn.index.KNNSettings;
Expand Down Expand Up @@ -132,7 +133,6 @@ public class KNNPlugin extends Plugin implements MapperPlugin, SearchPlugin, Act
public static final String KNN_BASE_URI = "/_plugins/_knn";

private KNNStats knnStats;
private ModelDao modelDao;
private ClusterService clusterService;

@Override
Expand Down Expand Up @@ -221,8 +221,13 @@ public List<RestHandler> getRestHandlers(Settings settings,

@Override
public Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings) {
return Optional.empty();
}

@Override
public Optional<CodecService> getCustomCodecService(IndexSettings indexSettings) {
if (indexSettings.getValue(KNNSettings.IS_KNN_INDEX_SETTING)) {
return Optional.of(new KNNEngineFactory());
return Optional.of(new KNNCodecService());
}
return Optional.empty();
}
Expand Down