Class DisruptableMockTransport
java.lang.Object
org.elasticsearch.test.transport.StubbableTransport
org.elasticsearch.test.transport.MockTransport
org.elasticsearch.test.disruption.DisruptableMockTransport
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.elasticsearch.common.component.LifecycleComponent
,org.elasticsearch.core.Releasable
,org.elasticsearch.transport.Transport
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Response type fromgetConnectionStatus(DiscoveryNode)
indicating whether, and how, messages should be disrupted on this transport.Nested classes/interfaces inherited from class org.elasticsearch.test.transport.StubbableTransport
StubbableTransport.OpenConnectionBehavior, StubbableTransport.RequestHandlingBehavior<Request extends org.elasticsearch.transport.TransportRequest>, StubbableTransport.SendRequestBehavior, StubbableTransport.WrappedConnection
Nested classes/interfaces inherited from interface org.elasticsearch.transport.Transport
org.elasticsearch.transport.Transport.Connection, org.elasticsearch.transport.Transport.RequestHandlers, org.elasticsearch.transport.Transport.ResponseContext<T extends org.elasticsearch.transport.TransportResponse>, org.elasticsearch.transport.Transport.ResponseHandlers
-
Constructor Summary
ConstructorsConstructorDescriptionDisruptableMockTransport(org.elasticsearch.cluster.node.DiscoveryNode localNode, org.apache.logging.log4j.Logger logger, DeterministicTaskQueue deterministicTaskQueue)
-
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.transport.TransportService
createTransportService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.transport.TransportInterceptor interceptor, Function<org.elasticsearch.common.transport.BoundTransportAddress,org.elasticsearch.cluster.node.DiscoveryNode> localNodeFactory, org.elasticsearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders)
protected abstract void
protected abstract DisruptableMockTransport.ConnectionStatus
getConnectionStatus(org.elasticsearch.cluster.node.DiscoveryNode destination)
protected Runnable
getDisconnectException(long requestId, String action, org.elasticsearch.cluster.node.DiscoveryNode destination)
protected abstract Optional<DisruptableMockTransport>
getDisruptableMockTransport(org.elasticsearch.common.transport.TransportAddress address)
org.elasticsearch.cluster.node.DiscoveryNode
protected String
getRequestDescription(long requestId, String action, org.elasticsearch.cluster.node.DiscoveryNode destination)
protected void
onBlackholedDuringSend(long requestId, String action, DisruptableMockTransport destinationTransport)
protected void
onConnectedDuringSend(long requestId, String action, org.elasticsearch.transport.TransportRequest request, DisruptableMockTransport destinationTransport)
protected void
onDisconnectedDuringSend(long requestId, String action, DisruptableMockTransport destinationTransport)
protected void
onSendRequest(long requestId, String action, org.elasticsearch.transport.TransportRequest request, DisruptableMockTransport destinationTransport)
void
openConnection(org.elasticsearch.cluster.node.DiscoveryNode node, org.elasticsearch.transport.ConnectionProfile profile, org.elasticsearch.action.ActionListener<org.elasticsearch.transport.Transport.Connection> listener)
Methods inherited from class org.elasticsearch.test.transport.MockTransport
createConnection, handleError, handleLocalError, handleRemoteError, handleResponse, onSendRequest, setMessageListener, writeableRegistry
Methods inherited from class org.elasticsearch.test.transport.StubbableTransport
addLifecycleListener, addressesFromString, boundAddress, close, getDefaultSeedAddresses, getRequestHandlers, getResponseHandlers, getStats, lifecycleState, profileBoundAddresses, removeLifecycleListener, setDefaultConnectBehavior, start, stop
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.transport.Transport
isSecure, registerRequestHandler, setSlowLogThreshold
-
Constructor Details
-
DisruptableMockTransport
public DisruptableMockTransport(org.elasticsearch.cluster.node.DiscoveryNode localNode, org.apache.logging.log4j.Logger logger, DeterministicTaskQueue deterministicTaskQueue)
-
-
Method Details
-
getConnectionStatus
protected abstract DisruptableMockTransport.ConnectionStatus getConnectionStatus(org.elasticsearch.cluster.node.DiscoveryNode destination) -
getDisruptableMockTransport
protected abstract Optional<DisruptableMockTransport> getDisruptableMockTransport(org.elasticsearch.common.transport.TransportAddress address) -
execute
-
getLocalNode
public org.elasticsearch.cluster.node.DiscoveryNode getLocalNode() -
createTransportService
public org.elasticsearch.transport.TransportService createTransportService(org.elasticsearch.common.settings.Settings settings, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.transport.TransportInterceptor interceptor, Function<org.elasticsearch.common.transport.BoundTransportAddress,org.elasticsearch.cluster.node.DiscoveryNode> localNodeFactory, @Nullable org.elasticsearch.common.settings.ClusterSettings clusterSettings, Set<String> taskHeaders)- Overrides:
createTransportService
in classMockTransport
-
openConnection
public void openConnection(org.elasticsearch.cluster.node.DiscoveryNode node, org.elasticsearch.transport.ConnectionProfile profile, org.elasticsearch.action.ActionListener<org.elasticsearch.transport.Transport.Connection> listener)- Specified by:
openConnection
in interfaceorg.elasticsearch.transport.Transport
- Overrides:
openConnection
in classStubbableTransport
-
onSendRequest
protected void onSendRequest(long requestId, String action, org.elasticsearch.transport.TransportRequest request, DisruptableMockTransport destinationTransport) -
getDisconnectException
-
getRequestDescription
-
onBlackholedDuringSend
protected void onBlackholedDuringSend(long requestId, String action, DisruptableMockTransport destinationTransport) -
onDisconnectedDuringSend
protected void onDisconnectedDuringSend(long requestId, String action, DisruptableMockTransport destinationTransport) -
onConnectedDuringSend
protected void onConnectedDuringSend(long requestId, String action, org.elasticsearch.transport.TransportRequest request, DisruptableMockTransport destinationTransport)
-