Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readException()

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readException() . 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: DistributedResultRequest.java    From crate with Apache License 2.0 6 votes vote down vote up
public DistributedResultRequest(StreamInput in) throws IOException {
    super(in);
    jobId = new UUID(in.readLong(), in.readLong());
    executionPhaseId = in.readVInt();
    bucketIdx = in.readVInt();
    isLast = in.readBoolean();
    inputId = in.readByte();

    boolean failure = in.readBoolean();
    if (failure) {
        throwable = in.readException();
        isKilled = in.readBoolean();
    } else {
        rows = new StreamBucket(in);
    }
}
 
Example 2
Source File: TcpTransport.java    From crate with Apache License 2.0 5 votes vote down vote up
/**
 * Executed for a received response error
 */
private void handlerResponseError(StreamInput stream, final TransportResponseHandler handler) {
    Exception error;
    try {
        error = stream.readException();
    } catch (Exception e) {
        error = new TransportSerializationException("Failed to deserialize exception response from stream", e);
    }
    handleException(handler, error);
}
 
Example 3
Source File: TransportNodesListGatewayStartedShards.java    From crate with Apache License 2.0 5 votes vote down vote up
public NodeGatewayStartedShards(StreamInput in) throws IOException {
    super(in);
    allocationId = in.readOptionalString();
    primary = in.readBoolean();
    if (in.readBoolean()) {
        storeException = in.readException();
    } else {
        storeException = null;
    }
}
 
Example 4
Source File: UnassignedInfo.java    From crate with Apache License 2.0 5 votes vote down vote up
public UnassignedInfo(StreamInput in) throws IOException {
    this.reason = Reason.values()[(int) in.readByte()];
    this.unassignedTimeMillis = in.readLong();
    // As System.nanoTime() cannot be compared across different JVMs, reset it to now.
    // This means that in master fail-over situations, elapsed delay time is forgotten.
    this.unassignedTimeNanos = System.nanoTime();
    this.delayed = in.readBoolean();
    this.message = in.readOptionalString();
    this.failure = in.readException();
    this.failedAllocations = in.readVInt();
    this.lastAllocationStatus = AllocationStatus.readFrom(in);
}
 
Example 5
Source File: ShardStateAction.java    From crate with Apache License 2.0 5 votes vote down vote up
FailedShardEntry(StreamInput in) throws IOException {
    super(in);
    shardId = new ShardId(in);
    allocationId = in.readString();
    primaryTerm = in.readVLong();
    message = in.readString();
    failure = in.readException();
    markAsStale = in.readBoolean();
}
 
Example 6
Source File: ReplicationResponse.java    From crate with Apache License 2.0 5 votes vote down vote up
public Failure(StreamInput in) throws IOException {
    shardId = new ShardId(in);
    super.shardId = shardId.getId();
    index = shardId.getIndexName();
    nodeId = in.readOptionalString();
    cause = in.readException();
    status = RestStatus.readFrom(in);
    primary = in.readBoolean();
}
 
Example 7
Source File: ShardResponse.java    From crate with Apache License 2.0 5 votes vote down vote up
public ShardResponse(StreamInput in) throws IOException {
    super(in);
    int size = in.readVInt();
    locations = new IntArrayList(size);
    failures = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        locations.add(in.readVInt());
        if (in.readBoolean()) {
            failures.add(new Failure(in));
        } else {
            failures.add(null);
        }
    }
    if (in.readBoolean()) {
        failure = in.readException();
    }
    if (in.getVersion().onOrAfter(Version.V_4_2_0)) {
        int resultColumnsSize = in.readVInt();
        if (resultColumnsSize > 0) {
            resultColumns = new Symbol[resultColumnsSize];
            for (int i = 0; i < resultColumnsSize; i++) {
                Symbol symbol = Symbols.fromStream(in);
                resultColumns[i] = symbol;
            }
            Streamer[] resultRowStreamers = Symbols.streamerArray(List.of(resultColumns));
            int resultRowsSize = in.readVInt();
            if (resultRowsSize > 0) {
                resultRows = new ArrayList<>(resultRowsSize);
                int rowLength = in.readVInt();
                for (int i = 0; i < resultRowsSize; i++) {
                    Object[] row = new Object[rowLength];
                    for (int j = 0; j < rowLength; j++) {
                        row[j] = resultRowStreamers[j].readValueFrom(in);
                    }
                    resultRows.add(row);
                }
            }
        }
    }
}
 
Example 8
Source File: ElasticsearchException.java    From crate with Apache License 2.0 4 votes vote down vote up
public ElasticsearchException(StreamInput in) throws IOException {
    super(in.readOptionalString(), in.readException());
    readStackTrace(this, in);
    headers.putAll(in.readMapOfLists(StreamInput::readString, StreamInput::readString));
    metadata.putAll(in.readMapOfLists(StreamInput::readString, StreamInput::readString));
}
 
Example 9
Source File: NodeAllocationResult.java    From crate with Apache License 2.0 4 votes vote down vote up
public ShardStoreInfo(StreamInput in) throws IOException {
    this.inSync = in.readBoolean();
    this.allocationId = in.readOptionalString();
    this.matchingBytes = in.readLong();
    this.storeException = in.readException();
}
 
Example 10
Source File: DefaultShardOperationFailedException.java    From crate with Apache License 2.0 4 votes vote down vote up
public DefaultShardOperationFailedException(StreamInput in) throws IOException {
    index = in.readOptionalString();
    shardId = in.readVInt();
    cause = in.readException();
    status = RestStatus.readFrom(in);
}