diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskInfo.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskInfo.java index 37b42f54919..6bc360fff95 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskInfo.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TaskInfo.java @@ -81,11 +81,7 @@ public class TaskInfo implements Writeable, ToXContent { type = in.readString(); action = in.readString(); description = in.readOptionalString(); - if (in.readBoolean()) { - status = in.readTaskStatus(); - } else { - status = null; - } + status = in.readOptionalNamedWriteable(Task.Status.class); startTime = in.readLong(); runningTimeNanos = in.readLong(); cancellable = in.readBoolean(); @@ -164,12 +160,7 @@ public class TaskInfo implements Writeable, ToXContent { out.writeString(type); out.writeString(action); out.writeOptionalString(description); - if (status != null) { - out.writeBoolean(true); - out.writeTaskStatus(status); - } else { - out.writeBoolean(false); - } + out.writeOptionalNamedWriteable(status); out.writeLong(startTime); out.writeLong(runningTimeNanos); out.writeBoolean(cancellable); diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java b/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java index 7bcb1e0a65f..fb26023cbce 100644 --- a/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java +++ b/core/src/main/java/org/elasticsearch/common/io/stream/StreamInput.java @@ -38,7 +38,6 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder; import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.phrase.SmoothingModel; -import org.elasticsearch.tasks.Task; import org.joda.time.DateTime; import org.joda.time.DateTimeZone; @@ -769,15 +768,6 @@ public abstract class StreamInput extends InputStream { return readNamedWriteable(SmoothingModel.class); } - /** - * Reads a {@link Task.Status} from the current stream. - * @deprecated prefer {@link #readNamedWriteable(Class)} passing {@link Task.Status}. - */ - @Deprecated - public Task.Status readTaskStatus() throws IOException { - return readNamedWriteable(Task.Status.class); - } - /** * Reads a list of objects */ diff --git a/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java b/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java index 07876ea615b..ba2fffbce4f 100644 --- a/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java +++ b/core/src/main/java/org/elasticsearch/common/io/stream/StreamOutput.java @@ -37,7 +37,6 @@ import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.functionscore.ScoreFunctionBuilder; import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.phrase.SmoothingModel; -import org.elasticsearch.tasks.Task; import org.joda.time.DateTimeZone; import org.joda.time.ReadableInstant; @@ -724,15 +723,6 @@ public abstract class StreamOutput extends OutputStream { writeNamedWriteable(smoothinModel); } - /** - * Writes a {@link Task.Status} to the current stream. - * @deprecated prefer {@link #writeNamedWriteable(NamedWriteable)} - */ - @Deprecated - public void writeTaskStatus(Task.Status status) throws IOException { - writeNamedWriteable(status); - } - /** * Writes the given {@link GeoPoint} to the stream */