Remove BWC layer for rejected execution exception

The serialization changes for rejected execution exceptions has been
backported to 6.x with the intention to appear in all versions since
6.3.0. Therefore, this BWC layer is no longer needed in master since
master would never speak to a node that does not speak the same
serialization.
This commit is contained in:
Jason Tedor 2018-03-16 14:40:17 -04:00
parent 6bf742dd1b
commit 1f1a4d17b4
2 changed files with 3 additions and 26 deletions

View File

@ -748,13 +748,6 @@ public abstract class StreamInput extends InputStream {
switch (key) {
case 0:
final int ord = readVInt();
// TODO: remove the if branch when master is bumped to 8.0.0
assert Version.CURRENT.major < 8;
if (ord == 59) {
final ElasticsearchException ex = new ElasticsearchException(this);
final boolean isExecutorShutdown = readBoolean();
return (T) new EsRejectedExecutionException(ex.getMessage(), isExecutorShutdown);
}
return (T) ElasticsearchException.readException(this, ord);
case 1:
String msg1 = readOptionalString();

View File

@ -854,25 +854,9 @@ public abstract class StreamOutput extends OutputStream {
} else if (throwable instanceof IOException) {
writeVInt(17);
} else if (throwable instanceof EsRejectedExecutionException) {
// TODO: remove the if branch when master is bumped to 8.0.0
assert Version.CURRENT.major < 8;
if (version.before(Version.V_7_0_0_alpha1)) {
/*
* This is a backwards compatibility layer when speaking to nodes that still treated EsRejectedExceutionException as an
* instance of ElasticsearchException. As such, we serialize this in a way that the receiving node would read this as an
* EsRejectedExecutionException.
*/
final ElasticsearchException ex = new ElasticsearchException(throwable.getMessage());
writeVInt(0);
writeVInt(59);
ex.writeTo(this);
writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown());
return;
} else {
writeVInt(18);
writeBoolean(((EsRejectedExecutionException) throwable).isExecutorShutdown());
writeCause = false;
}
} else {
final ElasticsearchException ex;
if (throwable instanceof ElasticsearchException && ElasticsearchException.isRegistered(throwable.getClass(), version)) {