@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tasks = Collections.unmodifiableList(in.readList(TaskInfo::new)); }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeList(tasks); }
protected void toXContentCommon(XContentBuilder builder, ToXContent.Params params) throws IOException { if (getTaskFailures() != null && getTaskFailures().size() > 0) { builder.startArray(TASK_FAILURES); for (TaskOperationFailure ex : getTaskFailures()){ builder.startObject(); builder.value(ex); builder.endObject(); } builder.endArray(); } if (getNodeFailures() != null && getNodeFailures().size() > 0) { builder.startArray(NODE_FAILURES); for (ElasticsearchException ex : getNodeFailures()) { builder.startObject(); ex.toXContent(builder, params); builder.endObject(); } builder.endArray(); } }
/** * Rethrow task failures if there are any. */ public void rethrowFailures(String operationName) { rethrowAndSuppress(Stream.concat( getNodeFailures().stream(), getTaskFailures().stream().map(f -> new ElasticsearchException( "{} of [{}] failed", f.getCause(), operationName, new TaskId(f.getNodeId(), f.getTaskId())))) .collect(toList())); }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeList(tasks); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tasks = Collections.unmodifiableList(in.readList(new StreamInputReader<TaskInfo>() { @Override public TaskInfo read(StreamInput t) throws IOException { return new TaskInfo(t); } })); }
protected void toXContentCommon(XContentBuilder builder, ToXContent.Params params) throws IOException { if (getTaskFailures() != null && getTaskFailures().size() > 0) { builder.startArray(TASK_FAILURES); for (TaskOperationFailure ex : getTaskFailures()){ builder.startObject(); builder.value(ex); builder.endObject(); } builder.endArray(); } if (getNodeFailures() != null && getNodeFailures().size() > 0) { builder.startArray(NODE_FAILURES); for (ElasticsearchException ex : getNodeFailures()) { builder.startObject(); ex.toXContent(builder, params); builder.endObject(); } builder.endArray(); } }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeList(tasks); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tasks = Collections.unmodifiableList(in.readList(TaskInfo::new)); }
/** * Rethrow task failures if there are any. */ public void rethrowFailures(String operationName) { rethrowAndSuppress(Stream.concat( getNodeFailures().stream(), getTaskFailures().stream().map(f -> new ElasticsearchException( "{} of [{}] failed", f.getCause(), operationName, new TaskId(f.getNodeId(), f.getTaskId())))) .collect(toList())); }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeList(tasks); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tasks = Collections.unmodifiableList(in.readList(TaskInfo::new)); }
/** * Rethrow task failures if there are any. */ public void rethrowFailures(String operationName) { rethrowAndSuppress(Stream.concat( getNodeFailures().stream(), getTaskFailures().stream().map(f -> new ElasticsearchException( "{} of [{}] failed", f.getCause(), operationName, new TaskId(f.getNodeId(), f.getTaskId())))) .collect(toList())); }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeList(tasks); }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); tasks = Collections.unmodifiableList(in.readList(TaskInfo::new)); }
/** * Rethrow task failures if there are any. */ public void rethrowFailures(String operationName) { rethrowAndSuppress(Stream.concat( getNodeFailures().stream(), getTaskFailures().stream().map(f -> new ElasticsearchException( "{} of [{}] failed", f.getCause(), operationName, new TaskId(f.getNodeId(), f.getTaskId())))) .collect(toList())); }