Skip to content

Commit

Permalink
Pass Noop Tracer instead of injected tracer
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyansh Ray <rayshrey@amazon.com>
  • Loading branch information
rayshrey committed Oct 20, 2023
1 parent 8db4a65 commit f46af51
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
import org.opensearch.indices.IndicesService;
import org.opensearch.indices.SystemIndices;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.threadpool.ThreadPool.Names;
import org.opensearch.transport.TransportException;
Expand Down Expand Up @@ -94,8 +94,7 @@ public TransportResyncReplicationAction(
ShardStateAction shardStateAction,
ActionFilters actionFilters,
IndexingPressureService indexingPressureService,
SystemIndices systemIndices,
Tracer tracer
SystemIndices systemIndices
) {
super(
settings,
Expand All @@ -112,7 +111,7 @@ public TransportResyncReplicationAction(
true, /* we should never reject resync because of thread pool capacity on primary */
indexingPressureService,
systemIndices,
tracer
NoopTracer.INSTANCE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
import org.opensearch.indices.IndicesService;
import org.opensearch.indices.SystemIndices;
import org.opensearch.tasks.Task;
import org.opensearch.telemetry.tracing.Tracer;
import org.opensearch.telemetry.tracing.noop.NoopTracer;
import org.opensearch.threadpool.ThreadPool;
import org.opensearch.transport.TransportException;
import org.opensearch.transport.TransportResponseHandler;
Expand Down Expand Up @@ -100,8 +100,7 @@ public RetentionLeaseSyncAction(
final ShardStateAction shardStateAction,
final ActionFilters actionFilters,
final IndexingPressureService indexingPressureService,
final SystemIndices systemIndices,
final Tracer tracer
final SystemIndices systemIndices
) {
super(
settings,
Expand All @@ -118,7 +117,7 @@ public RetentionLeaseSyncAction(
false,
indexingPressureService,
systemIndices,
tracer
NoopTracer.INSTANCE
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ public void testResyncDoesNotBlockOnPrimaryAction() throws Exception {
shardStateAction,
new ActionFilters(new HashSet<>()),
new IndexingPressureService(Settings.EMPTY, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);

assertThat(action.globalBlockLevel(), nullValue());
Expand Down Expand Up @@ -257,8 +256,7 @@ private TransportResyncReplicationAction createAction() {
mock(ShardStateAction.class),
new ActionFilters(new HashSet<>()),
mock(IndexingPressureService.class),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,7 @@ public void testRetentionLeaseSyncActionOnPrimary() {
shardStateAction,
new ActionFilters(Collections.emptySet()),
new IndexingPressureService(Settings.EMPTY, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);
final RetentionLeases retentionLeases = mock(RetentionLeases.class);
final RetentionLeaseSyncAction.Request request = new RetentionLeaseSyncAction.Request(indexShard.shardId(), retentionLeases);
Expand Down Expand Up @@ -163,8 +162,7 @@ public void testRetentionLeaseSyncActionOnReplica() throws Exception {
shardStateAction,
new ActionFilters(Collections.emptySet()),
new IndexingPressureService(Settings.EMPTY, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);
final RetentionLeases retentionLeases = mock(RetentionLeases.class);
final RetentionLeaseSyncAction.Request request = new RetentionLeaseSyncAction.Request(indexShard.shardId(), retentionLeases);
Expand Down Expand Up @@ -205,8 +203,7 @@ public void testBlocks() {
shardStateAction,
new ActionFilters(Collections.emptySet()),
new IndexingPressureService(Settings.EMPTY, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);

assertNull(action.indexBlockLevel());
Expand Down Expand Up @@ -236,8 +233,7 @@ private RetentionLeaseSyncAction createAction() {
shardStateAction,
new ActionFilters(Collections.emptySet()),
new IndexingPressureService(Settings.EMPTY, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2123,8 +2123,7 @@ public void onFailure(final Exception e) {
shardStateAction,
actionFilters,
new IndexingPressureService(settings, clusterService),
new SystemIndices(emptyMap()),
NoopTracer.INSTANCE
new SystemIndices(emptyMap())
)
),
new GlobalCheckpointSyncAction(
Expand Down

0 comments on commit f46af51

Please sign in to comment.