-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bharathwaj G <[email protected]>
- Loading branch information
1 parent
bc6fe9b
commit 3571ec8
Showing
32 changed files
with
749 additions
and
168 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
server/src/main/java/org/apache/lucene/index/DocValuesWriterWrapper.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,18 @@ | ||
/* | ||
* 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.apache.lucene.index; | ||
|
||
import org.apache.lucene.search.DocIdSetIterator; | ||
|
||
/** | ||
* Base wrapper class for DocValuesWriter. | ||
*/ | ||
public abstract class DocValuesWriterWrapper<T extends DocIdSetIterator> { | ||
public abstract T getDocValues(); | ||
} |
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
58 changes: 58 additions & 0 deletions
58
server/src/main/java/org/apache/lucene/index/SortedSetDocValuesWriterWrapper.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,58 @@ | ||
/* | ||
* 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.apache.lucene.index; | ||
|
||
import org.apache.lucene.util.ByteBlockPool; | ||
import org.apache.lucene.util.BytesRef; | ||
import org.apache.lucene.util.Counter; | ||
|
||
/** | ||
* A wrapper class for writing sorted set doc values. | ||
* <p> | ||
* This class provides a convenient way to add sorted set doc values to a field | ||
* and retrieve the corresponding {@link SortedSetDocValues} instance. | ||
* | ||
* @opensearch.experimental | ||
*/ | ||
public class SortedSetDocValuesWriterWrapper extends DocValuesWriterWrapper<SortedSetDocValues> { | ||
|
||
private final SortedSetDocValuesWriter sortedSetDocValuesWriterWrapper; | ||
|
||
/** | ||
* Sole constructor. Constructs a new {@link SortedSetDocValuesWriterWrapper} instance. | ||
* | ||
* @param fieldInfo the field information for the field being written | ||
* @param counter a counter for tracking memory usage | ||
* @param byteBlockPool a byte block pool for allocating byte blocks | ||
* @see SortedSetDocValuesWriter | ||
*/ | ||
public SortedSetDocValuesWriterWrapper(FieldInfo fieldInfo, Counter counter, ByteBlockPool byteBlockPool) { | ||
sortedSetDocValuesWriterWrapper = new SortedSetDocValuesWriter(fieldInfo, counter, byteBlockPool); | ||
} | ||
|
||
/** | ||
* Adds a bytes ref value to the sorted set doc values for the specified document. | ||
* | ||
* @param docID the document ID | ||
* @param value the value to add | ||
*/ | ||
public void addValue(int docID, BytesRef value) { | ||
sortedSetDocValuesWriterWrapper.addValue(docID, value); | ||
} | ||
|
||
/** | ||
* Returns the {@link SortedSetDocValues} instance containing the sorted numeric doc values | ||
* | ||
* @return the {@link SortedSetDocValues} instance | ||
*/ | ||
@Override | ||
public SortedSetDocValues getDocValues() { | ||
return sortedSetDocValuesWriterWrapper.getDocValues(); | ||
} | ||
} |
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
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
Oops, something went wrong.