Skip to content

Commit 17a95a5

Browse files
Remove some Dead Code in o.e.transport (#44653)
* None of this is used
1 parent 42a331c commit 17a95a5

File tree

5 files changed

+4
-93
lines changed

5 files changed

+4
-93
lines changed

server/src/main/java/org/elasticsearch/transport/RemoteClusterConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ final class RemoteClusterConnection implements TransportConnectionListener, Clos
9292
private volatile boolean skipUnavailable;
9393
private final ConnectHandler connectHandler;
9494
private final TimeValue initialConnectionTimeout;
95-
private SetOnce<ClusterName> remoteClusterName = new SetOnce<>();
95+
private final SetOnce<ClusterName> remoteClusterName = new SetOnce<>();
9696

9797
/**
9898
* Creates a new {@link RemoteClusterConnection}

server/src/main/java/org/elasticsearch/transport/Transport.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
import org.elasticsearch.Version;
2323
import org.elasticsearch.action.ActionListener;
2424
import org.elasticsearch.cluster.node.DiscoveryNode;
25-
import org.elasticsearch.common.breaker.CircuitBreaker;
26-
import org.elasticsearch.common.breaker.NoopCircuitBreaker;
2725
import org.elasticsearch.common.component.LifecycleComponent;
2826
import org.elasticsearch.common.transport.BoundTransportAddress;
2927
import org.elasticsearch.common.transport.TransportAddress;
3028
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
3129
import org.elasticsearch.common.util.concurrent.ConcurrentMapLong;
30+
3231
import java.io.Closeable;
3332
import java.io.IOException;
3433
import java.net.UnknownHostException;
@@ -74,10 +73,6 @@ public interface Transport extends LifecycleComponent {
7473
*/
7574
List<String> getDefaultSeedAddresses();
7675

77-
default CircuitBreaker getInFlightRequestBreaker() {
78-
return new NoopCircuitBreaker("in-flight-noop");
79-
}
80-
8176
/**
8277
* Opens a new connection to the given node. When the connection is fully connected, the listener is called.
8378
* The ActionListener will be called on the calling thread or the generic thread pool.

server/src/main/java/org/elasticsearch/transport/TransportChannelResponseHandler.java

Lines changed: 0 additions & 76 deletions
This file was deleted.

server/src/main/java/org/elasticsearch/transport/TransportService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -723,7 +723,7 @@ protected void doRun() throws Exception {
723723
}
724724

725725
private void sendLocalRequest(long requestId, final String action, final TransportRequest request, TransportRequestOptions options) {
726-
final DirectResponseChannel channel = new DirectResponseChannel(logger, localNode, action, requestId, this, threadPool);
726+
final DirectResponseChannel channel = new DirectResponseChannel(localNode, action, requestId, this, threadPool);
727727
try {
728728
onRequestSent(localNode, requestId, action, request, options);
729729
onRequestReceived(requestId, action);
@@ -1131,16 +1131,13 @@ void setTimeoutHandler(TimeoutHandler handler) {
11311131
}
11321132

11331133
static class DirectResponseChannel implements TransportChannel {
1134-
final Logger logger;
11351134
final DiscoveryNode localNode;
11361135
private final String action;
11371136
private final long requestId;
11381137
final TransportService service;
11391138
final ThreadPool threadPool;
11401139

1141-
DirectResponseChannel(Logger logger, DiscoveryNode localNode, String action, long requestId, TransportService service,
1142-
ThreadPool threadPool) {
1143-
this.logger = logger;
1140+
DirectResponseChannel(DiscoveryNode localNode, String action, long requestId, TransportService service, ThreadPool threadPool) {
11441141
this.localNode = localNode;
11451142
this.action = action;
11461143
this.requestId = requestId;

server/src/main/java/org/elasticsearch/transport/TransportSettings.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,4 @@ public final class TransportSettings {
119119

120120
private TransportSettings() {
121121
}
122-
123-
private static <T> Setting<T> fallback(String key, Setting.AffixSetting<T> affixSetting, String regex, String replacement) {
124-
return "_na_".equals(key) ? affixSetting.getConcreteSettingForNamespace(key)
125-
: affixSetting.getConcreteSetting(key.replaceAll(regex, replacement));
126-
}
127122
}

0 commit comments

Comments
 (0)