Search in sources :

Example 46 with TransportException

use of org.elasticsearch.transport.TransportException in project crate by crate.

the class JoinHelperTests method testFailedJoinAttemptLogLevel.

public void testFailedJoinAttemptLogLevel() {
    assertThat(JoinHelper.FailedJoinAttempt.getLogLevel(new TransportException("generic transport exception")), is(Level.INFO));
    assertThat(JoinHelper.FailedJoinAttempt.getLogLevel(new RemoteTransportException("remote transport exception with generic cause", new Exception())), is(Level.INFO));
    assertThat(JoinHelper.FailedJoinAttempt.getLogLevel(new RemoteTransportException("caused by CoordinationStateRejectedException", new CoordinationStateRejectedException("test"))), is(Level.DEBUG));
    assertThat(JoinHelper.FailedJoinAttempt.getLogLevel(new RemoteTransportException("caused by FailedToCommitClusterStateException", new FailedToCommitClusterStateException("test"))), is(Level.DEBUG));
    assertThat(JoinHelper.FailedJoinAttempt.getLogLevel(new RemoteTransportException("caused by NotMasterException", new NotMasterException("test"))), is(Level.DEBUG));
}
Also used : RemoteTransportException(org.elasticsearch.transport.RemoteTransportException) NotMasterException(org.elasticsearch.cluster.NotMasterException) RemoteTransportException(org.elasticsearch.transport.RemoteTransportException) TransportException(org.elasticsearch.transport.TransportException) NotMasterException(org.elasticsearch.cluster.NotMasterException) RemoteTransportException(org.elasticsearch.transport.RemoteTransportException) TransportException(org.elasticsearch.transport.TransportException)

Aggregations

TransportException (org.elasticsearch.transport.TransportException)46 DiscoveryNode (org.elasticsearch.cluster.node.DiscoveryNode)30 IOException (java.io.IOException)28 StreamInput (org.elasticsearch.common.io.stream.StreamInput)17 ElasticsearchException (org.elasticsearch.ElasticsearchException)16 ClusterState (org.elasticsearch.cluster.ClusterState)16 ParameterizedMessage (org.apache.logging.log4j.message.ParameterizedMessage)15 TransportResponse (org.elasticsearch.transport.TransportResponse)14 TransportResponseHandler (org.elasticsearch.transport.TransportResponseHandler)12 TransportService (org.elasticsearch.transport.TransportService)12 Settings (org.elasticsearch.common.settings.Settings)10 ClusterService (org.elasticsearch.cluster.service.ClusterService)9 ConnectTransportException (org.elasticsearch.transport.ConnectTransportException)9 EmptyTransportResponseHandler (org.elasticsearch.transport.EmptyTransportResponseHandler)9 Version (org.elasticsearch.Version)8 DiscoveryNodes (org.elasticsearch.cluster.node.DiscoveryNodes)8 TimeValue (io.crate.common.unit.TimeValue)7 ArrayList (java.util.ArrayList)7 Consumer (java.util.function.Consumer)7 ClusterStateObserver (org.elasticsearch.cluster.ClusterStateObserver)7