rename node close to node closed exception

This commit is contained in:
kimchy 2010-07-23 01:12:36 +03:00
parent 34b84b0e61
commit 5706e5f6b9
3 changed files with 10 additions and 8 deletions

View File

@ -31,7 +31,7 @@ import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.discovery.MasterNotDiscoveredException;
import org.elasticsearch.node.NodeCloseException;
import org.elasticsearch.node.NodeClosedException;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.*;
@ -109,7 +109,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
@Override public void onClose() {
clusterService.remove(this);
listener.onFailure(new NodeCloseException(nodes.localNode()));
listener.onFailure(new NodeClosedException(nodes.localNode()));
}
@Override public void onTimeout(TimeValue timeout) {
@ -155,7 +155,7 @@ public abstract class TransportMasterNodeOperationAction<Request extends MasterN
@Override public void onClose() {
clusterService.remove(this);
listener.onFailure(new NodeCloseException(nodes.localNode()));
listener.onFailure(new NodeClosedException(nodes.localNode()));
}
@Override public void onTimeout(TimeValue timeout) {

View File

@ -46,7 +46,7 @@ import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.shard.service.IndexShard;
import org.elasticsearch.indices.IndexMissingException;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.node.NodeCloseException;
import org.elasticsearch.node.NodeClosedException;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.*;
@ -295,7 +295,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
@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 (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeCloseException ||
if (exp.unwrapCause() instanceof ConnectTransportException || exp.unwrapCause() instanceof NodeClosedException ||
exp.unwrapCause() instanceof IllegalIndexShardStateException) {
primaryOperationStarted.set(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() {
clusterService.remove(this);
listener.onFailure(new NodeCloseException(nodes.localNode()));
listener.onFailure(new NodeClosedException(nodes.localNode()));
}
@Override public void clusterChanged(ClusterChangedEvent event) {

View File

@ -23,13 +23,15 @@ import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.cluster.node.DiscoveryNode;
/**
* An exception indicating that node is closed.
*
* @author kimchy (shay.banon)
*/
public class NodeCloseException extends ElasticSearchException {
public class NodeClosedException extends ElasticSearchException {
private final DiscoveryNode node;
public NodeCloseException(DiscoveryNode node) {
public NodeClosedException(DiscoveryNode node) {
super("node closed " + node);
this.node = node;
}