-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor codec and doc format classes for Lucene 9.1
Signed-off-by: Martin Gaievski <[email protected]>
- Loading branch information
1 parent
7711d48
commit f4bca46
Showing
14 changed files
with
181 additions
and
25 deletions.
There are no files selected for viewing
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
37 changes: 37 additions & 0 deletions
37
src/main/java/org/opensearch/knn/index/codec/KNN91Codec/KNN91DocFormat.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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.knn.index.codec.KNN91Codec; | ||
|
||
import org.apache.lucene.codecs.CompoundFormat; | ||
import org.apache.lucene.codecs.DocValuesFormat; | ||
import org.opensearch.knn.index.codec.KNNDocFormatFacade; | ||
|
||
public class KNN91DocFormat implements KNNDocFormatFacade { | ||
|
||
private final DocValuesFormat docValuesFormat; | ||
private final CompoundFormat compoundFormat; | ||
|
||
public KNN91DocFormat(final DocValuesFormat docValuesFormat, final CompoundFormat compoundFormat) { | ||
this.docValuesFormat = docValuesFormat; | ||
this.compoundFormat = compoundFormat; | ||
} | ||
|
||
@Override | ||
public DocValuesFormat docValuesFormat() { | ||
return docValuesFormat; | ||
} | ||
|
||
@Override | ||
public CompoundFormat compoundFormat() { | ||
return compoundFormat; | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
...odec/KNN91Codec/KNN91BinaryDocValues.java → ...Codec/docformat/KNN91BinaryDocValues.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
10 changes: 8 additions & 2 deletions
10
...codec/KNN91Codec/KNN91CompoundFormat.java → ...1Codec/docformat/KNN91CompoundFormat.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
10 changes: 8 additions & 2 deletions
10
...ec/KNN91Codec/KNN91DocValuesConsumer.java → ...dec/docformat/KNN91DocValuesConsumer.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
10 changes: 8 additions & 2 deletions
10
...odec/KNN91Codec/KNN91DocValuesFormat.java → ...Codec/docformat/KNN91DocValuesFormat.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
10 changes: 8 additions & 2 deletions
10
...odec/KNN91Codec/KNN91DocValuesReader.java → ...Codec/docformat/KNN91DocValuesReader.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
22 changes: 22 additions & 0 deletions
22
src/main/java/org/opensearch/knn/index/codec/KNNCodecFactory.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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.knn.index.codec; | ||
|
||
import org.apache.lucene.codecs.Codec; | ||
import org.opensearch.knn.index.codec.KNN91Codec.KNN91Codec; | ||
|
||
public class KNNCodecFactory { | ||
|
||
public static Codec createKNN91Codec(Codec userCodec) { | ||
return new KNN91Codec(userCodec); | ||
} | ||
} |
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
22 changes: 22 additions & 0 deletions
22
src/main/java/org/opensearch/knn/index/codec/KNNDocFormatFacade.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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.knn.index.codec; | ||
|
||
import org.apache.lucene.codecs.CompoundFormat; | ||
import org.apache.lucene.codecs.DocValuesFormat; | ||
|
||
public interface KNNDocFormatFacade { | ||
|
||
DocValuesFormat docValuesFormat(); | ||
|
||
CompoundFormat compoundFormat(); | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/org/opensearch/knn/index/codec/KNNDocFormatFactory.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,28 @@ | ||
/* | ||
* 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. | ||
* | ||
* Modifications Copyright OpenSearch Contributors. See | ||
* GitHub history for details. | ||
*/ | ||
|
||
package org.opensearch.knn.index.codec; | ||
|
||
import org.apache.lucene.codecs.Codec; | ||
import org.opensearch.knn.index.codec.KNN91Codec.docformat.KNN91CompoundFormat; | ||
import org.opensearch.knn.index.codec.KNN91Codec.KNN91DocFormat; | ||
import org.opensearch.knn.index.codec.KNN91Codec.docformat.KNN91DocValuesFormat; | ||
|
||
public class KNNDocFormatFactory { | ||
|
||
public static KNNDocFormatFacade createKNN91DocFormat(Codec delegate) { | ||
final KNNDocFormatFacade knnDocFormatFacade = new KNN91DocFormat( | ||
new KNN91DocValuesFormat(delegate.docValuesFormat()), | ||
new KNN91CompoundFormat(delegate.compoundFormat()) | ||
); | ||
return knnDocFormatFacade; | ||
} | ||
} |
10 changes: 8 additions & 2 deletions
10
...KNN91Codec/KNN91BinaryDocValuesTests.java → .../docformat/KNN91BinaryDocValuesTests.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
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
10 changes: 8 additions & 2 deletions
10
...N91Codec/KNN91DocValuesConsumerTests.java → ...ocformat/KNN91DocValuesConsumerTests.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