Java Code Examples for org.elasticsearch.common.io.stream.StreamOutput#writeException()
The following examples show how to use
org.elasticsearch.common.io.stream.StreamOutput#writeException() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElasticsearchException.java From crate with Apache License 2.0 | 6 votes |
/** * Serializes the given exceptions stacktrace elements as well as it's suppressed exceptions to the given output stream. */ public static <T extends Throwable> T writeStackTraces(T throwable, StreamOutput out) throws IOException { StackTraceElement[] stackTrace = throwable.getStackTrace(); out.writeVInt(stackTrace.length); for (StackTraceElement element : stackTrace) { out.writeString(element.getClassName()); out.writeOptionalString(element.getFileName()); out.writeString(element.getMethodName()); out.writeVInt(element.getLineNumber()); } Throwable[] suppressed = throwable.getSuppressed(); out.writeVInt(suppressed.length); for (Throwable t : suppressed) { out.writeException(t); } return throwable; }
Example 2
Source File: DistributedResultRequest.java From crate with Apache License 2.0 | 6 votes |
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeLong(jobId.getMostSignificantBits()); out.writeLong(jobId.getLeastSignificantBits()); out.writeVInt(executionPhaseId); out.writeVInt(bucketIdx); out.writeBoolean(isLast); out.writeByte(inputId); boolean failure = throwable != null; out.writeBoolean(failure); if (failure) { out.writeException(throwable); out.writeBoolean(isKilled); } else { rows.writeTo(out); } }
Example 3
Source File: ElasticsearchException.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(this.getMessage()); out.writeException(this.getCause()); writeStackTraces(this, out); out.writeMapOfLists(headers, StreamOutput::writeString, StreamOutput::writeString); out.writeMapOfLists(metadata, StreamOutput::writeString, StreamOutput::writeString); }
Example 4
Source File: TransportNodesListGatewayStartedShards.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); out.writeOptionalString(allocationId); out.writeBoolean(primary); if (storeException != null) { out.writeBoolean(true); out.writeException(storeException); } else { out.writeBoolean(false); } }
Example 5
Source File: UnassignedInfo.java From crate with Apache License 2.0 | 5 votes |
public void writeTo(StreamOutput out) throws IOException { out.writeByte((byte) reason.ordinal()); out.writeLong(unassignedTimeMillis); // Do not serialize unassignedTimeNanos as System.nanoTime() cannot be compared across different JVMs out.writeBoolean(delayed); out.writeOptionalString(message); out.writeException(failure); out.writeVInt(failedAllocations); lastAllocationStatus.writeTo(out); }
Example 6
Source File: NodeAllocationResult.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(inSync); out.writeOptionalString(allocationId); out.writeLong(matchingBytes); out.writeException(storeException); }
Example 7
Source File: ShardStateAction.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); shardId.writeTo(out); out.writeString(allocationId); out.writeVLong(primaryTerm); out.writeString(message); out.writeException(failure); out.writeBoolean(markAsStale); }
Example 8
Source File: ReplicationResponse.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { shardId.writeTo(out); out.writeOptionalString(nodeId); out.writeException(cause); RestStatus.writeTo(out, status); out.writeBoolean(primary); }
Example 9
Source File: DefaultShardOperationFailedException.java From crate with Apache License 2.0 | 5 votes |
@Override public void writeTo(StreamOutput out) throws IOException { out.writeOptionalString(index); out.writeVInt(shardId); out.writeException(cause); RestStatus.writeTo(out, status); }