Remove (read|write)TaskStatus

This commit is contained in:
Nik Everett 2016-04-18 19:53:32 -04:00
parent 52f7c20344
commit cd75c3da2e
3 changed files with 2 additions and 31 deletions

View File

@ -81,11 +81,7 @@ public class TaskInfo implements Writeable<TaskInfo>, 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<TaskInfo>, 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);

View File

@ -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
*/

View File

@ -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
*/