/* * Copyright OpenSearch Contributors * SPDX-License-Identifier: Apache-2.0 */ package org.opensearch.knn.index.codec.util; import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.DocIDMerger; import org.apache.lucene.index.MergeState; import java.io.IOException; /** * Place holder class for the docIds and the respective * binary values. */ public class BinaryDocValuesSub extends DocIDMerger.Sub { private final BinaryDocValues values; public BinaryDocValuesSub(MergeState.DocMap docMap, BinaryDocValues values) { super(docMap); if (values == null || (values.docID() != -1)) { throw new IllegalStateException("Doc values is either null or docID is not -1 "); } this.values = values; } @Override public int nextDoc() throws IOException { return values.nextDoc(); } public BinaryDocValues getValues() { return values; } }