From f8f5b220029628f62bd16eab7a60085a6bb6b92f Mon Sep 17 00:00:00 2001 From: vikasvb90 Date: Tue, 14 May 2024 21:27:14 +0530 Subject: [PATCH] Added support of copying remote directory without specifying whether its a low priority upload Signed-off-by: vikasvb90 --- .../index/store/RemoteSegmentStoreDirectory.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java b/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java index 8c0ecb4cc783a..3e4e027922285 100644 --- a/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java +++ b/server/src/main/java/org/opensearch/index/store/RemoteSegmentStoreDirectory.java @@ -442,6 +442,21 @@ public IndexInput openInput(String name, IOContext context) throws IOException { } } + /** + * Copies a file from the source directory to a remote based on multi-stream upload support. + * If vendor plugin supports uploading multiple parts in parallel, BlobContainer#writeBlobByStreams + * will be used, else, the legacy {@link RemoteSegmentStoreDirectory#copyFrom(Directory, String, String, IOContext)} + * will be called. + * + * @param from The directory for the file to be uploaded + * @param src File to be uploaded + * @param context IOContext to be used to open IndexInput of file during remote upload + * @param listener Listener to handle upload callback events + */ + public void copyFrom(Directory from, String src, IOContext context, ActionListener listener) { + copyFrom(from, src, context, listener, false); + } + /** * Copies a file from the source directory to a remote based on multi-stream upload support. * If vendor plugin supports uploading multiple parts in parallel, BlobContainer#writeBlobByStreams