totalShards += nodes.get(exception.nodeId()).size(); for (ShardRouting shard : nodes.get(exception.nodeId())) { exceptions.add(new DefaultShardOperationFailedException(shard.getIndexName(), shard.getId(), exception)); for (BroadcastShardOperationFailedException throwable : response.getExceptions()) { if (!TransportActions.isShardNotAvailableException(throwable)) { exceptions.add(new DefaultShardOperationFailedException(throwable.getShardId().getIndexName(), throwable.getShardId().getId(), throwable));
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("shard", shardId()); builder.field("index", index()); builder.field("status", status.name()); if (reason != null) { builder.startObject("reason"); ElasticsearchException.generateThrowableXContent(builder, params, cause); builder.endObject(); } return builder; }
public static DefaultShardOperationFailedException readShardOperationFailed(StreamInput in) throws IOException { DefaultShardOperationFailedException exp = new DefaultShardOperationFailedException(); exp.readFrom(in); return exp; }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(nodeId); super.writeTo(out); }
@Override public void readFrom(StreamInput in) throws IOException { nodeId = in.readString(); super.readFrom(in); }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("node", nodeId()); super.toXContent(builder, params); return builder; } }
@Override public String toString() { return "[" + index + "][" + shardId + "] failed, reason [" + reason() + "]"; }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); totalShards = in.readVInt(); successfulShards = in.readVInt(); failedShards = in.readVInt(); int size = in.readVInt(); if (size > 0) { shardFailures = new DefaultShardOperationFailedException[size]; for (int i = 0; i < size; i++) { shardFailures[i] = readShardOperationFailed(in); } } }
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeVInt(totalShards); out.writeVInt(successfulShards); out.writeVInt(failedShards); out.writeVInt(shardFailures.length); for (DefaultShardOperationFailedException exp : shardFailures) { exp.writeTo(out); } }
@Override public void readFrom(StreamInput in) throws IOException { nodeId = in.readString(); super.readFrom(in); }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("node", nodeId()); super.toXContent(builder, params); return builder; } }
@Override public String toString() { return "[" + index + "][" + shardId + "] failed, reason [" + reason() + "]"; }
@Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); totalShards = in.readVInt(); successfulShards = in.readVInt(); failedShards = in.readVInt(); int size = in.readVInt(); if (size > 0) { shardFailures = new ShardOperationFailedException[size]; for (int i = 0; i < size; i++) { shardFailures[i] = readShardOperationFailed(in); } } }
shardFailures = new ArrayList<>(); shardFailures.add(new DefaultShardOperationFailedException((BroadcastShardOperationFailedException) shardResponse)); } else { ShardValidateQueryResponse validateQueryResponse = (ShardValidateQueryResponse) shardResponse;
public static DefaultShardOperationFailedException readShardOperationFailed(StreamInput in) throws IOException { DefaultShardOperationFailedException exp = new DefaultShardOperationFailedException(); exp.readFrom(in); return exp; }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("shard", shardId()); builder.field("index", index()); builder.field("status", status.name()); if (reason != null) { builder.startObject("reason"); ElasticsearchException.generateThrowableXContent(builder, params, reason); builder.endObject(); } return builder; }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(nodeId); super.writeTo(out); }
@Override public void readFrom(StreamInput in) throws IOException { nodeId = in.readString(); super.readFrom(in); }
@Override public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException { builder.field("node", nodeId()); super.toXContent(builder, params); return builder; } }
@Override public String toString() { return "[" + index + "][" + shardId + "] failed, reason [" + reason() + "]"; }