forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 2
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: Sachin Kale <[email protected]>
- Loading branch information
Sachin Kale
committed
Sep 1, 2024
1 parent
770a791
commit 4a68ff5
Showing
14 changed files
with
395 additions
and
83 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...r/src/internalClusterTest/java/org/opensearch/remotestore/RestoreShallowSnapshotV2IT.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,47 @@ | ||
/* | ||
* 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.opensearch.remotestore; | ||
|
||
import org.opensearch.common.settings.Settings; | ||
import org.opensearch.indices.RemoteStoreSettings; | ||
import org.opensearch.repositories.blobstore.BlobStoreRepository; | ||
import org.opensearch.test.OpenSearchIntegTestCase; | ||
|
||
import java.nio.file.Path; | ||
|
||
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked; | ||
|
||
@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.TEST, numDataNodes = 0) | ||
public class RestoreShallowSnapshotV2IT extends RemoteRestoreSnapshotIT { | ||
@Override | ||
protected Settings nodeSettings(int nodeOrdinal) { | ||
return Settings.builder() | ||
.put(super.nodeSettings(nodeOrdinal)) | ||
.put(RemoteStoreSettings.CLUSTER_REMOTE_STORE_PINNED_TIMESTAMP_ENABLED.getKey(), true) | ||
.build(); | ||
} | ||
|
||
@Override | ||
protected void createRepository(String repoName, String type, Settings.Builder settings) { | ||
logger.info("--> creating repository [{}] [{}]", repoName, type); | ||
settings.put(BlobStoreRepository.REMOTE_STORE_INDEX_SHALLOW_COPY.getKey(), true) | ||
.put(BlobStoreRepository.SHALLOW_SNAPSHOT_V2.getKey(), true); | ||
assertAcked(clusterAdmin().preparePutRepository(repoName).setType(type).setSettings(settings)); | ||
} | ||
|
||
@Override | ||
protected void createRepository(String repoName, String type, Path location) { | ||
Settings.Builder settings = Settings.builder() | ||
.put("location", location) | ||
.put(BlobStoreRepository.REMOTE_STORE_INDEX_SHALLOW_COPY.getKey(), true) | ||
.put(BlobStoreRepository.SHALLOW_SNAPSHOT_V2.getKey(), true); | ||
|
||
createRepository(repoName, type, settings); | ||
} | ||
} |
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.