當前位置: 首頁>>代碼示例>>Java>>正文


Java StreamInput.readException方法代碼示例

本文整理匯總了Java中org.elasticsearch.common.io.stream.StreamInput.readException方法的典型用法代碼示例。如果您正苦於以下問題:Java StreamInput.readException方法的具體用法?Java StreamInput.readException怎麽用?Java StreamInput.readException使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.common.io.stream.StreamInput的用法示例。


在下文中一共展示了StreamInput.readException方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: ElasticsearchException

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
public ElasticsearchException(StreamInput in) throws IOException {
    super(in.readOptionalString(), in.readException());
    readStackTrace(this, in);
    headers.putAll(in.readMapOfLists(StreamInput::readString, StreamInput::readString));
    if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        metadata.putAll(in.readMapOfLists(StreamInput::readString, StreamInput::readString));
    } else {
        for (Iterator<Map.Entry<String, List<String>>> iterator = headers.entrySet().iterator(); iterator.hasNext(); ) {
            Map.Entry<String, List<String>> header = iterator.next();
            if (header.getKey().startsWith("es.")) {
                metadata.put(header.getKey(), header.getValue());
                iterator.remove();
            }
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:17,代碼來源:ElasticsearchException.java

示例2: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        this.response = new SearchTemplateResponse();
        response.readFrom(in);
    } else {
        exception = in.readException();
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:MultiSearchTemplateResponse.java

示例3: handlerResponseError

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * 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);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:TcpTransport.java

示例4: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    if (in.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // legacy version
        in.readLong();
    }
    allocationId = in.readOptionalString();
    primary = in.readBoolean();
    if (in.readBoolean()) {
        storeException = in.readException();
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:14,代碼來源:TransportNodesListGatewayStartedShards.java

示例5: SearchFailure

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * Read from a stream.
 */
public SearchFailure(StreamInput in) throws IOException {
    reason = in.readException();
    index = in.readOptionalString();
    shardId = in.readOptionalVInt();
    nodeId = in.readOptionalString();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:ScrollableHitSource.java

示例6: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    shardId = ShardId.readShardId(in);
    allocationId = in.readString();
    primaryTerm = in.readVLong();
    message = in.readString();
    failure = in.readException();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:ShardStateAction.java

示例7: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    node = new DiscoveryNode(in);
    if (in.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // legacy version
        in.readLong();
    }
    allocationId = in.readOptionalString();
    allocationStatus = AllocationStatus.readFrom(in);
    if (in.readBoolean()) {
        storeException = in.readException();
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:14,代碼來源:IndicesShardStoresResponse.java

示例8: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readOptionalString();
    id = in.readString();
    exception = in.readException();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:8,代碼來源:MultiGetResponse.java

示例9: serialize

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
private <T extends Exception> T serialize(T exception, Version version) throws IOException {
    ElasticsearchAssertions.assertVersionSerializable(version, exception);
    BytesStreamOutput out = new BytesStreamOutput();
    out.setVersion(version);
    out.writeException(exception);

    StreamInput in = out.bytes().streamInput();
    in.setVersion(version);
    return in.readException();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:ExceptionSerializationTests.java

示例10: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        this.response = new SearchResponse();
        response.readFrom(in);
    } else {
        exception = in.readException();
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:MultiSearchResponse.java

示例11: TaskOperationFailure

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * Read from a stream.
 */
public TaskOperationFailure(StreamInput in) throws IOException {
    nodeId = in.readString();
    taskId = in.readLong();
    reason = in.readException();
    status = RestStatus.readFrom(in);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:TaskOperationFailure.java

示例12: Failure

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * Read from a stream.
 */
public Failure(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readString();
    id = in.readOptionalString();
    cause = in.readException();
    status = ExceptionsHelper.status(cause);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:BulkItemResponse.java

示例13: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        index = in.readString();
    }
    shardId = in.readVInt();
    reason = in.readException();
    status = RestStatus.readFrom(in);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:DefaultShardOperationFailedException.java

示例14: SimulateProcessorResult

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * Read from a stream.
 */
SimulateProcessorResult(StreamInput in) throws IOException {
    this.processorTag = in.readString();
    if (in.readBoolean()) {
        this.ingestDocument = new WriteableIngestDocument(in);
    } else {
        this.ingestDocument = null;
    }
    this.failure = in.readException();
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:SimulateProcessorResult.java

示例15: SimulateDocumentBaseResult

import org.elasticsearch.common.io.stream.StreamInput; //導入方法依賴的package包/類
/**
 * Read from a stream.
 */
public SimulateDocumentBaseResult(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        ingestDocument = null;
        failure = in.readException();
    } else {
        ingestDocument = new WriteableIngestDocument(in);
        failure = null;
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:13,代碼來源:SimulateDocumentBaseResult.java


注:本文中的org.elasticsearch.common.io.stream.StreamInput.readException方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。