Skip to content

Commit

Permalink
spotless fix
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Bafna <[email protected]>
  • Loading branch information
gbbafna committed Feb 2, 2024
1 parent 0519cfa commit e8b2e31
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static org.hamcrest.Matchers.greaterThan;
import static org.opensearch.node.remotestore.RemoteStoreNodeAttribute.REMOTE_STORE_REPOSITORY_SETTINGS_ATTRIBUTE_KEY_PREFIX;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.greaterThan;

@OpenSearchIntegTestCase.ClusterScope(scope = OpenSearchIntegTestCase.Scope.SUITE, numDataNodes = 0)
public class RemoteStoreRestoreIT extends BaseRemoteStoreRestoreIT {
Expand Down Expand Up @@ -480,7 +480,14 @@ public void testRateLimitedRemoteDownloads() throws Exception {
settingsMap.entrySet().forEach(entry -> settings.put(entry.getKey(), entry.getValue()));
settings.put("location", segmentRepoPath).put("max_remote_download_bytes_per_sec", 4, ByteSizeUnit.KB);

assertAcked(client().admin().cluster().preparePutRepository(REPOSITORY_NAME).setType(ReloadableFsRepository.TYPE).setSettings(settings).get());
assertAcked(
client().admin()
.cluster()
.preparePutRepository(REPOSITORY_NAME)
.setType(ReloadableFsRepository.TYPE)
.setSettings(settings)
.get()
);

for (RepositoriesService repositoriesService : internalCluster().getDataNodeInstances(RepositoriesService.class)) {
Repository segmentRepo = repositoriesService.repository(REPOSITORY_NAME);
Expand Down Expand Up @@ -509,7 +516,14 @@ public void testRateLimitedRemoteDownloads() throws Exception {
// revert repo metadata to pass asserts on repo metadata vs. node attrs during teardown
// https://github.com/opensearch-project/OpenSearch/pull/9569#discussion_r1345668700
settings.remove("max_remote_download_bytes_per_sec");
assertAcked(client().admin().cluster().preparePutRepository(REPOSITORY_NAME).setType(ReloadableFsRepository.TYPE).setSettings(settings).get());
assertAcked(
client().admin()
.cluster()
.preparePutRepository(REPOSITORY_NAME)
.setType(ReloadableFsRepository.TYPE)
.setSettings(settings)
.get()
);
for (RepositoriesService repositoriesService : internalCluster().getDataNodeInstances(RepositoriesService.class)) {
Repository segmentRepo = repositoriesService.repository(REPOSITORY_NAME);
assertNull(segmentRepo.getMetadata().settings().get("max_remote_download_bytes_per_sec"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

package org.opensearch.snapshots;

import org.junit.Before;
import org.opensearch.client.Client;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.common.unit.ByteSizeValue;
import org.opensearch.repositories.RepositoryException;
import org.opensearch.repositories.fs.ReloadableFsRepository;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.junit.Before;

import java.nio.file.Path;

Expand Down Expand Up @@ -65,7 +65,12 @@ public void testSystemRepositoryNonRestrictedSettingsCanBeUpdated() {
final Settings.Builder repoSettings = Settings.builder().put("location", absolutePath).put("chunk_size", new ByteSizeValue(20));

assertAcked(
client.admin().cluster().preparePutRepository(systemRepoName).setType(ReloadableFsRepository.TYPE).setSettings(repoSettings).get()
client.admin()
.cluster()
.preparePutRepository(systemRepoName)
.setType(ReloadableFsRepository.TYPE)
.setSettings(repoSettings)
.get()
);
}
}

0 comments on commit e8b2e31

Please sign in to comment.