Skip to content

Commit ec0f609

Browse files
author
Shubh Sahu
committed
Addressing comments
Signed-off-by: Shubh Sahu <[email protected]>
1 parent 3e86036 commit ec0f609

File tree

3 files changed

+37
-5
lines changed

3 files changed

+37
-5
lines changed

server/src/main/java/org/opensearch/index/shard/IndexShard.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,6 @@ public org.apache.lucene.util.Version minimumCompatibleVersion() {
16291629
* @return Tuple(Tuple(primaryTerm, commitGeneration), indexFilesToFileLengthMap)
16301630
* @throws IOException
16311631
*/
1632-
16331632
public Tuple<Tuple<Long, Long>, Map<String, Long>> acquireLastRemoteUploadedIndexCommit() throws IOException {
16341633
if (!indexSettings.isAssignedOnRemoteNode()) {
16351634
throw new IllegalStateException("Index is not assigned on Remote Node");

server/src/main/java/org/opensearch/repositories/FilterRepository.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ public void snapshotRemoteStoreIndexShard(
237237
String shardStateIdentifier,
238238
IndexShardSnapshotStatus snapshotStatus,
239239
long primaryTerm,
240-
long commitGeneration,
241240
long startTime,
242-
Map<String, Long> indexFilesToFileLengthMap,
243241
ActionListener<String> listener
244242
) {
245243
in.snapshotRemoteStoreIndexShard(
@@ -250,9 +248,7 @@ public void snapshotRemoteStoreIndexShard(
250248
shardStateIdentifier,
251249
snapshotStatus,
252250
primaryTerm,
253-
commitGeneration,
254251
startTime,
255-
indexFilesToFileLengthMap,
256252
listener
257253
);
258254
}

server/src/main/java/org/opensearch/repositories/Repository.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,43 @@ void snapshotShard(
402402
* @param startTime start time of the snapshot commit, this will be used as the start time for snapshot.
403403
* @param listener listener invoked on completion
404404
*/
405+
default void snapshotRemoteStoreIndexShard(
406+
Store store,
407+
SnapshotId snapshotId,
408+
IndexId indexId,
409+
IndexCommit snapshotIndexCommit,
410+
@Nullable String shardStateIdentifier,
411+
IndexShardSnapshotStatus snapshotStatus,
412+
long primaryTerm,
413+
long startTime,
414+
ActionListener<String> listener
415+
) {
416+
throw new UnsupportedOperationException();
417+
}
418+
419+
/**
420+
* Adds a reference of remote store data for a index commit point.
421+
* <p>
422+
* The index commit point can be obtained by using {@link org.opensearch.index.engine.Engine#acquireLastIndexCommit} method.
423+
* Or for closed index can be obtained by reading last remote uploaded metadata by using {@link org.opensearch.index.shard.IndexShard#acquireLastRemoteUploadedIndexCommit} method.
424+
* Repository implementations shouldn't release the snapshot index commit point. It is done by the method caller.
425+
* <p>
426+
* As snapshot process progresses, implementation of this method should update {@link IndexShardSnapshotStatus} object and check
427+
* {@link IndexShardSnapshotStatus#isAborted()} to see if the snapshot process should be aborted.
428+
* @param store store to be snapshotted
429+
* @param snapshotId snapshot id
430+
* @param indexId id for the index being snapshotted
431+
* @param snapshotIndexCommit commit point
432+
* @param shardStateIdentifier a unique identifier of the state of the shard that is stored with the shard's snapshot and used
433+
* to detect if the shard has changed between snapshots. If {@code null} is passed as the identifier
434+
* snapshotting will be done by inspecting the physical files referenced by {@code snapshotIndexCommit}
435+
* @param snapshotStatus snapshot status
436+
* @param primaryTerm current Primary Term
437+
* @param commitGeneration current commit generation
438+
* @param startTime start time of the snapshot commit, this will be used as the start time for snapshot.
439+
* @param indexFilesToFileLengthMap map of index files to file length
440+
* @param listener listener invoked on completion
441+
*/
405442
default void snapshotRemoteStoreIndexShard(
406443
Store store,
407444
SnapshotId snapshotId,

0 commit comments

Comments
 (0)