Skip to content

Commit b0da471

Browse files
committed
Add missing field to PersistedTaskInfo
1 parent 9d6d815 commit b0da471

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

core/src/main/java/org/elasticsearch/tasks/PersistedTaskInfo.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws
160160
}
161161

162162
public XContentBuilder innerToXContent(XContentBuilder builder, Params params) throws IOException {
163+
builder.field("completed", completed);
163164
builder.field("task", task);
164165
if (error != null) {
165166
XContentHelper.writeRawField("error", error, builder, params);
@@ -171,8 +172,16 @@ public XContentBuilder innerToXContent(XContentBuilder builder, Params params) t
171172
}
172173

173174
public static final ConstructingObjectParser<PersistedTaskInfo, ParseFieldMatcherSupplier> PARSER = new ConstructingObjectParser<>(
174-
"persisted_task_info", a -> new PersistedTaskInfo(true, (TaskInfo) a[0], (BytesReference) a[1], (BytesReference) a[2]));
175+
"persisted_task_info", a -> {
176+
int i = 0;
177+
boolean completed = (boolean) a[i++];
178+
TaskInfo task = (TaskInfo) a[i++];
179+
BytesReference error = (BytesReference) a[i++];
180+
BytesReference response = (BytesReference) a[i++];
181+
return new PersistedTaskInfo(completed, task, error, response);
182+
});
175183
static {
184+
PARSER.declareBoolean(constructorArg(), new ParseField("completed"));
176185
PARSER.declareObject(constructorArg(), TaskInfo.PARSER, new ParseField("task"));
177186
PARSER.declareRawObject(optionalConstructorArg(), new ParseField("error"));
178187
PARSER.declareRawObject(optionalConstructorArg(), new ParseField("response"));

0 commit comments

Comments
 (0)