rename node close to node closed exception
This commit is contained in:
parent
34b84b0e61
commit
5706e5f6b9
|
@ -31,7 +31,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.discovery.MasterNotDiscoveredException;
|
import org.elasticsearch.discovery.MasterNotDiscoveredException;
|
||||||
import org.elasticsearch.node.NodeCloseException;
|
import org.elasticsearch.node.NodeClosedException;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.*;
|
import org.elasticsearch.transport.*;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
||||||
|
|
||||||
@Override public void onClose() {
|
@Override public void onClose() {
|
||||||
clusterService.remove(this);
|
clusterService.remove(this);
|
||||||
listener.onFailure(new NodeCloseException(nodes.localNode()));
|
listener.onFailure(new NodeClosedException(nodes.localNode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onTimeout(TimeValue timeout) {
|
@Override public void onTimeout(TimeValue timeout) {
|
||||||
|
@ -155,7 +155,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
|
||||||
|
|
||||||
@Override public void onClose() {
|
@Override public void onClose() {
|
||||||
clusterService.remove(this);
|
clusterService.remove(this);
|
||||||
listener.onFailure(new NodeCloseException(nodes.localNode()));
|
listener.onFailure(new NodeClosedException(nodes.localNode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void onTimeout(TimeValue timeout) {
|
@Override public void onTimeout(TimeValue timeout) {
|
||||||
|
|
|
@ -46,7 +46,7 @@ import org.elasticsearch.index.shard.ShardId;
|
||||||
import org.elasticsearch.index.shard.service.IndexShard;
|
import org.elasticsearch.index.shard.service.IndexShard;
|
||||||
import org.elasticsearch.indices.IndexMissingException;
|
import org.elasticsearch.indices.IndexMissingException;
|
||||||
import org.elasticsearch.indices.IndicesService;
|
import org.elasticsearch.indices.IndicesService;
|
||||||
import org.elasticsearch.node.NodeCloseException;
|
import org.elasticsearch.node.NodeClosedException;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.transport.*;
|
import org.elasticsearch.transport.*;
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||||
|
|
||||||
@Override public void handleException(RemoteTransportException exp) {
|
@Override public void handleException(RemoteTransportException exp) {
|
||||||
// if we got disconnected from the node, or the node / shard is not in the right state (being closed)
|
// if we got disconnected from the node, or the node / shard is not in the right state (being closed)
|
||||||
if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeCloseException ||
|
if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeClosedException ||
|
||||||
exp.unwrapCause() instanceof IllegalIndexShardStateException) {
|
exp.unwrapCause() instanceof IllegalIndexShardStateException) {
|
||||||
primaryOperationStarted.set(false);
|
primaryOperationStarted.set(false);
|
||||||
// we already marked it as started when we executed it (removed the listener) so pass false
|
// we already marked it as started when we executed it (removed the listener) so pass false
|
||||||
|
@ -344,7 +344,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||||
|
|
||||||
@Override public void onClose() {
|
@Override public void onClose() {
|
||||||
clusterService.remove(this);
|
clusterService.remove(this);
|
||||||
listener.onFailure(new NodeCloseException(nodes.localNode()));
|
listener.onFailure(new NodeClosedException(nodes.localNode()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public void clusterChanged(ClusterChangedEvent event) {
|
@Override public void clusterChanged(ClusterChangedEvent event) {
|
||||||
|
|
|
@ -23,13 +23,15 @@ import org.elasticsearch.ElasticSearchException;
|
||||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* An exception indicating that node is closed.
|
||||||
|
*
|
||||||
* @author kimchy (shay.banon)
|
* @author kimchy (shay.banon)
|
||||||
*/
|
*/
|
||||||
public class NodeCloseException extends ElasticSearchException {
|
public class NodeClosedException extends ElasticSearchException {
|
||||||
|
|
||||||
private final DiscoveryNode node;
|
private final DiscoveryNode node;
|
||||||
|
|
||||||
public NodeCloseException(DiscoveryNode node) {
|
public NodeClosedException(DiscoveryNode node) {
|
||||||
super("node closed " + node);
|
super("node closed " + node);
|
||||||
this.node = node;
|
this.node = node;
|
||||||
}
|
}
|
Loading…
Reference in New Issue