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

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readThrowable() . 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 Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(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.readThrowable();
    } else {
        StreamBucket bucket = new StreamBucket(streamers);
        bucket.readFrom(in);
        rows = bucket;
    }
}
 
Example 2
Source File: ShardResponse.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(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(Failure.readFailure(in));
        } else {
            failures.add(null);
        }
    }
    if (in.readBoolean()) {
        failure = in.readThrowable();
    }
}
 
Example 3
Source File: IndicesShardStoresResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    node = DiscoveryNode.readNode(in);
    version = in.readLong();
    allocation = Allocation.readFrom(in);
    if (in.readBoolean()) {
        storeException = in.readThrowable();
    }
}
 
Example 4
Source File: MultiTermVectorsResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readOptionalString();
    id = in.readString();
    cause = in.readThrowable();
}
 
Example 5
Source File: ActionWriteResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    shardId = in.readVInt();
    nodeId = in.readOptionalString();
    cause = in.readThrowable();
    status = RestStatus.readFrom(in);
    primary = in.readBoolean();
}
 
Example 6
Source File: DefaultShardOperationFailedException.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        index = in.readString();
    }
    shardId = in.readVInt();
    reason = in.readThrowable();
    status = RestStatus.readFrom(in);
}
 
Example 7
Source File: MultiSearchResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        this.response = new SearchResponse();
        response.readFrom(in);
    } else {
        throwable = in.readThrowable();
    }
}
 
Example 8
Source File: ShardSearchFailure.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        shardTarget = readSearchShardTarget(in);
    }
    reason = in.readString();
    status = RestStatus.readFrom(in);
    cause = in.readThrowable();
}
 
Example 9
Source File: MultiPercolateResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        response = new PercolateResponse();
        response.readFrom(in);
    } else {
        throwable = in.readThrowable();
    }
}
 
Example 10
Source File: MultiGetResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readOptionalString();
    id = in.readString();
    throwable = in.readThrowable();
}
 
Example 11
Source File: ShardStateAction.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    shardRouting = readShardRoutingEntry(in);
    indexUUID = in.readString();
    message = in.readString();
    finderNodeId = in.readString();
    failure = in.readThrowable();
}
 
Example 12
Source File: UnassignedInfo.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
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 failover situations, elapsed delay time is forgotten.
    this.unassignedTimeNanos = System.nanoTime();
    this.message = in.readOptionalString();
    this.failure = in.readThrowable();
}
 
Example 13
Source File: TransportNodesListGatewayStartedShards.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    version = in.readLong();
    numDocs = in.readLong();
    if (in.readBoolean()) {
        storeException = in.readThrowable();
    }

}
 
Example 14
Source File: MessageChannelHandler.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
private void handlerResponseError(StreamInput buffer, final TransportResponseHandler handler) {
    Throwable error;
    try {
        error = buffer.readThrowable();
    } catch (Throwable e) {
        error = new TransportSerializationException("Failed to deserialize exception response from stream", e);
    }
    handleException(handler, error);
}
 
Example 15
Source File: LocalTransport.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
private void handlerResponseError(StreamInput buffer, final TransportResponseHandler handler) {
    Throwable error;
    try {
        error = buffer.readThrowable();
    } catch (Throwable e) {
        error = new TransportSerializationException("Failed to deserialize exception response from stream", e);
    }
    handleException(handler, error);
}
 
Example 16
Source File: ElasticsearchException.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public ElasticsearchException(StreamInput in) throws IOException {
    super(in.readOptionalString(), in.readThrowable());
    readStackTrace(this, in);
    int numKeys = in.readVInt();
    for (int i = 0; i < numKeys; i++) {
        final String key = in.readString();
        final int numValues = in.readVInt();
        final ArrayList<String> values = new ArrayList<>(numValues);
        for (int j = 0; j < numValues; j++) {
            values.add(in.readString());
        }
        headers.put(key, values);
    }
}
 
Example 17
Source File: TaskOperationFailure.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public TaskOperationFailure(StreamInput in) throws IOException {
    nodeId = in.readString();
    taskId = in.readLong();
    reason = in.readThrowable();
    status = RestStatus.readFrom(in);
}
 
Example 18
Source File: VerificationFailure.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    nodeId = in.readOptionalString();
    cause = in.readThrowable();
}
 
Example 19
Source File: BulkItemResponse.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public Failure readFrom(StreamInput in) throws IOException {
    return new Failure(in.readString(), in.readString(), in.readOptionalString(), in.readThrowable());
}