forked from opensearch-project/k-NN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implented the code for polling the remote index status, and also adde…
…d some settings to run remote-index-build service Signed-off-by: Navneet Verma <navneev@amazon.com>
- Loading branch information
Showing
8 changed files
with
498 additions
and
80 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
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
53 changes: 53 additions & 0 deletions
53
src/main/java/org/opensearch/knn/index/codec/nativeindex/NativeIndexOutputStream.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,53 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.knn.index.codec.nativeindex; | ||
|
||
import lombok.Builder; | ||
import lombok.Value; | ||
import org.apache.commons.lang.NotImplementedException; | ||
import org.apache.lucene.store.IndexOutput; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
|
||
@Builder | ||
@Value | ||
public class NativeIndexOutputStream extends OutputStream { | ||
|
||
IndexOutput indexOutput; | ||
|
||
/** | ||
* Writes the specified byte to this output stream. The general | ||
* contract for {@code write} is that one byte is written | ||
* to the output stream. The byte to be written is the eight | ||
* low-order bits of the argument {@code b}. The 24 | ||
* high-order bits of {@code b} are ignored. | ||
* | ||
* @param b the {@code byte}. | ||
* @throws IOException if an I/O error occurs. In particular, | ||
* an {@code IOException} may be thrown if the | ||
* output stream has been closed. | ||
*/ | ||
@Override | ||
public void write(int b) throws IOException { | ||
throw new NotImplementedException("This function is not implemented"); | ||
} | ||
|
||
/** | ||
* Writes {@code b.length} bytes from the specified byte array | ||
* to this output stream. The general contract for {@code write(b)} | ||
* is that it should have exactly the same effect as the call | ||
* {@code write(b, 0, b.length)}. | ||
* | ||
* @param b the data. | ||
* @throws IOException if an I/O error occurs. | ||
* @see OutputStream#write(byte[], int, int) | ||
*/ | ||
@Override | ||
public void write(byte[] b) throws IOException { | ||
indexOutput.writeBytes(b, b.length); | ||
} | ||
} |
Oops, something went wrong.