Skip to content

Commit

Permalink
Remove TcpTransport#addressSupported since TransportAddress is now final
Browse files Browse the repository at this point in the history
TransportAddress used to be customizable per transport but this has been removed
a while ago. Therefore we can remove all usage of this method as well.

Relates to #20695
  • Loading branch information
s1monw committed Nov 28, 2016
1 parent 012960d commit b7292a6
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@
import org.elasticsearch.common.Priority;
import org.elasticsearch.common.component.AbstractLifecycleComponent;
import org.elasticsearch.common.component.Lifecycle;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.internal.Nullable;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.lease.Releasables;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Setting.Property;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -851,10 +849,7 @@ public static void validateStateIsFromCurrentMaster(Logger logger, DiscoveryNode
}

void handleJoinRequest(final DiscoveryNode node, final ClusterState state, final MembershipAction.JoinCallback callback) {
if (!transportService.addressSupported(node.getAddress().getClass())) {
// TODO, what should we do now? Maybe inform that node that its crap?
logger.warn("received a wrong address type from [{}], ignoring...", node);
} else if (nodeJoinController == null) {
if (nodeJoinController == null) {
throw new IllegalStateException("discovery module is not yet started");
} else {
// try and connect to the node, if it fails, we can raise an exception back to the client...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,11 +513,6 @@ protected Version getCurrentVersion() {
return Version.CURRENT;
}

@Override
public boolean addressSupported(Class<? extends TransportAddress> address) {
return TransportAddress.class.equals(address);
}

@Override
public BoundTransportAddress boundAddress() {
return this.boundAddress;
Expand Down
5 changes: 0 additions & 5 deletions core/src/main/java/org/elasticsearch/transport/Transport.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ public interface Transport extends LifecycleComponent {
*/
TransportAddress[] addressesFromString(String address, int perAddressLimit) throws UnknownHostException;

/**
* Is the address type supported.
*/
boolean addressSupported(Class<? extends TransportAddress> address);

/**
* Returns <tt>true</tt> if the node is connected.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,6 @@ public final void acceptIncomingRequests() {
blockIncomingRequestsLatch.countDown();
}

public final boolean addressSupported(Class<? extends TransportAddress> address) {
return transport.addressSupported(address);
}

public TransportInfo info() {
BoundTransportAddress boundTransportAddress = boundAddress();
if (boundTransportAddress == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ public TransportAddress[] addressesFromString(String address, int perAddressLimi
throw new UnsupportedOperationException();
}

@Override
public boolean addressSupported(Class<? extends TransportAddress> address) {
throw new UnsupportedOperationException();
}

@Override
public boolean nodeConnected(DiscoveryNode node) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ final class MockTransport implements Transport {

@Override
public void transportServiceAdapter(TransportServiceAdapter service) {

}

@Override
Expand All @@ -193,11 +192,6 @@ public TransportAddress[] addressesFromString(String address, int perAddressLimi
return new TransportAddress[0];
}

@Override
public boolean addressSupported(Class<? extends TransportAddress> address) {
return false;
}

@Override
public boolean nodeConnected(DiscoveryNode node) {
return connectedNodes.contains(node);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,6 @@ public TransportAddress[] addressesFromString(String address, int perAddressLimi
return new TransportAddress[0];
}

@Override
public boolean addressSupported(Class<? extends TransportAddress> address) {
return false;
}

@Override
public boolean nodeConnected(DiscoveryNode node) {
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,6 @@ public TransportAddress[] addressesFromString(String address, int perAddressLimi
return transport.addressesFromString(address, perAddressLimit);
}

@Override
public boolean addressSupported(Class<? extends TransportAddress> address) {
return transport.addressSupported(address);
}

@Override
public boolean nodeConnected(DiscoveryNode node) {
return transport.nodeConnected(node);
Expand Down

0 comments on commit b7292a6

Please sign in to comment.