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(); type = in.readString();
action = in.readString(); action = in.readString();
description = in.readOptionalString(); description = in.readOptionalString();
if (in.readBoolean()) { status = in.readOptionalNamedWriteable(Task.Status.class);
status = in.readTaskStatus();
} else {
status = null;
}
startTime = in.readLong(); startTime = in.readLong();
runningTimeNanos = in.readLong(); runningTimeNanos = in.readLong();
cancellable = in.readBoolean(); cancellable = in.readBoolean();
@ -164,12 +160,7 @@ public class TaskInfo implements Writeable<TaskInfo>, ToXContent {
out.writeString(type); out.writeString(type);
out.writeString(action); out.writeString(action);
out.writeOptionalString(description); out.writeOptionalString(description);
if (status != null) { out.writeOptionalNamedWriteable(status);
out.writeBoolean(true);
out.writeTaskStatus(status);
} else {
out.writeBoolean(false);
}
out.writeLong(startTime); out.writeLong(startTime);
out.writeLong(runningTimeNanos); out.writeLong(runningTimeNanos);
out.writeBoolean(cancellable); 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.index.query.functionscore.ScoreFunctionBuilder;
import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.phrase.SmoothingModel; import org.elasticsearch.search.suggest.phrase.SmoothingModel;
import org.elasticsearch.tasks.Task;
import org.joda.time.DateTime; import org.joda.time.DateTime;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
@ -769,15 +768,6 @@ public abstract class StreamInput extends InputStream {
return readNamedWriteable(SmoothingModel.class); 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 * 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.index.query.functionscore.ScoreFunctionBuilder;
import org.elasticsearch.search.suggest.SuggestionBuilder; import org.elasticsearch.search.suggest.SuggestionBuilder;
import org.elasticsearch.search.suggest.phrase.SmoothingModel; import org.elasticsearch.search.suggest.phrase.SmoothingModel;
import org.elasticsearch.tasks.Task;
import org.joda.time.DateTimeZone; import org.joda.time.DateTimeZone;
import org.joda.time.ReadableInstant; import org.joda.time.ReadableInstant;
@ -724,15 +723,6 @@ public abstract class StreamOutput extends OutputStream {
writeNamedWriteable(smoothinModel); 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 * Writes the given {@link GeoPoint} to the stream
*/ */