From ed94f75a1501dbd1a74871d4d62e0173e381dbd4 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Wed, 25 Jan 2017 10:58:26 +0100 Subject: [PATCH] Remove EngineClosedException All usage has been removed in https://github.com/elastic/elasticsearch/pull/22631, which is back ported to 5.x. This means 6.x will never get it on the wire and we can remove it --- .../elasticsearch/ElasticsearchException.java | 3 +- .../index/engine/EngineClosedException.java | 50 ------------------- .../ExceptionSerializationTests.java | 2 +- 3 files changed, 2 insertions(+), 53 deletions(-) delete mode 100644 core/src/main/java/org/elasticsearch/index/engine/EngineClosedException.java diff --git a/core/src/main/java/org/elasticsearch/ElasticsearchException.java b/core/src/main/java/org/elasticsearch/ElasticsearchException.java index 22abf3e52098c..849de78c7cf4c 100644 --- a/core/src/main/java/org/elasticsearch/ElasticsearchException.java +++ b/core/src/main/java/org/elasticsearch/ElasticsearchException.java @@ -869,8 +869,7 @@ enum ElasticsearchExceptionHandle { org.elasticsearch.search.SearchContextException::new, 127, UNKNOWN_VERSION_ADDED), SEARCH_SOURCE_BUILDER_EXCEPTION(org.elasticsearch.search.builder.SearchSourceBuilderException.class, org.elasticsearch.search.builder.SearchSourceBuilderException::new, 128, UNKNOWN_VERSION_ADDED), - ENGINE_CLOSED_EXCEPTION(org.elasticsearch.index.engine.EngineClosedException.class, - org.elasticsearch.index.engine.EngineClosedException::new, 129, UNKNOWN_VERSION_ADDED), + // 129 was EngineClosedException NO_SHARD_AVAILABLE_ACTION_EXCEPTION(org.elasticsearch.action.NoShardAvailableActionException.class, org.elasticsearch.action.NoShardAvailableActionException::new, 130, UNKNOWN_VERSION_ADDED), UNAVAILABLE_SHARDS_EXCEPTION(org.elasticsearch.action.UnavailableShardsException.class, diff --git a/core/src/main/java/org/elasticsearch/index/engine/EngineClosedException.java b/core/src/main/java/org/elasticsearch/index/engine/EngineClosedException.java deleted file mode 100644 index cc3ffcac6b0b9..0000000000000 --- a/core/src/main/java/org/elasticsearch/index/engine/EngineClosedException.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to Elasticsearch under one or more contributor - * license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright - * ownership. Elasticsearch licenses this file to you under - * the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.elasticsearch.index.engine; - -import org.elasticsearch.common.io.stream.StreamInput; -import org.elasticsearch.index.shard.IndexShardClosedException; -import org.elasticsearch.index.shard.ShardId; - -import java.io.IOException; - -/** - * An engine is already closed. - *

- * Note, the relationship between shard and engine indicates that engine closed is shard closed, and - * we might get something slipping through the shard and into the engine while the shard is closing. - * - * - */ -@Deprecated -public class EngineClosedException extends IndexShardClosedException { - - public EngineClosedException(ShardId shardId) { - super(shardId); - } - - public EngineClosedException(ShardId shardId, Throwable t) { - super(shardId, t); - } - - public EngineClosedException(StreamInput in) throws IOException{ - super(in); - } -} diff --git a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java index 9dee89639abab..2cd87c0470e8b 100644 --- a/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java +++ b/core/src/test/java/org/elasticsearch/ExceptionSerializationTests.java @@ -820,7 +820,7 @@ public void testIds() { ids.put(126, org.elasticsearch.index.mapper.MapperParsingException.class); ids.put(127, org.elasticsearch.search.SearchContextException.class); ids.put(128, org.elasticsearch.search.builder.SearchSourceBuilderException.class); - ids.put(129, org.elasticsearch.index.engine.EngineClosedException.class); + ids.put(129, null); // was org.elasticsearch.index.engine.EngineClosedException.class ids.put(130, org.elasticsearch.action.NoShardAvailableActionException.class); ids.put(131, org.elasticsearch.action.UnavailableShardsException.class); ids.put(132, org.elasticsearch.index.engine.FlushFailedEngineException.class);