Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Repository Plugin] Fix stats test #10880

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@
import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;

import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyTransactionIdStage;

import fixture.s3.S3HttpHandler;
import org.opensearch.action.admin.indices.forcemerge.ForceMergeResponse;
import org.opensearch.cluster.metadata.IndexMetadata;
import org.opensearch.cluster.metadata.RepositoryMetadata;
Expand Down Expand Up @@ -64,6 +62,7 @@
import org.opensearch.test.BackgroundIndexer;
import org.opensearch.test.OpenSearchIntegTestCase;
import org.opensearch.threadpool.ThreadPool;
import software.amazon.awssdk.core.internal.http.pipeline.stages.ApplyTransactionIdStage;

import java.io.IOException;
import java.nio.file.Path;
Expand All @@ -76,12 +75,10 @@
import java.util.Objects;
import java.util.stream.StreamSupport;

import fixture.s3.S3HttpHandler;

import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertAcked;
import static org.opensearch.test.hamcrest.OpenSearchAssertions.assertHitCount;

@SuppressForbidden(reason = "this test uses a HttpServer to emulate an S3 endpoint")
// Need to set up a new cluster for each test because cluster settings use randomized authentication settings
Expand Down Expand Up @@ -165,7 +162,6 @@ protected Settings nodeSettings(int nodeOrdinal) {
return builder.build();
}

@AwaitsFix(bugUrl = "https://github.com/opensearch-project/OpenSearch/issues/10735")
@Override
public void testRequestStats() throws Exception {
final String repository = createRepository(randomName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@

package org.opensearch.repositories.s3;

import software.amazon.awssdk.services.s3.model.ObjectCannedACL;
import software.amazon.awssdk.services.s3.model.StorageClass;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.opensearch.Version;
Expand Down Expand Up @@ -66,6 +63,8 @@
import org.opensearch.snapshots.SnapshotId;
import org.opensearch.snapshots.SnapshotInfo;
import org.opensearch.threadpool.Scheduler;
import software.amazon.awssdk.services.s3.model.ObjectCannedACL;
import software.amazon.awssdk.services.s3.model.StorageClass;

import java.nio.file.Path;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ default Map<String, Long> stats() {
* Returns details statistics of operations that have been performed on this blob store
*/
default Map<Metric, Map<String, Long>> extendedStats() {
return Collections.emptyMap();
return null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,7 +851,7 @@ public RepositoryStats stats() {
final BlobStore store = blobStore.get();
if (store == null) {
return RepositoryStats.EMPTY_STATS;
} else if (store.extendedStats() != null && store.extendedStats().isEmpty() == false) {
} else if (store.extendedStats() != null) {
return new RepositoryStats(store.extendedStats(), true);
}
return new RepositoryStats(store.stats());
Expand Down
Loading