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


Java StreamOutput.writeThrowable方法代碼示例

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


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

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(locations.size());
    for (int i = 0; i < locations.size(); i++) {
        out.writeVInt(locations.get(i));
        if (failures.get(i) == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            failures.get(i).writeTo(out);
        }
    }
    if (failure != null) {
        out.writeBoolean(true);
        out.writeThrowable(failure);
    } else {
        out.writeBoolean(false);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:21,代碼來源:ShardResponse.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@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.writeThrowable(throwable);
    } else {
        // TODO: we should not rely on another bucket in this class and instead write to the stream directly
        StreamBucket.writeBucket(out, streamers, rows);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:20,代碼來源:DistributedResultRequest.java

示例3: writeStackTraces

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
/**
 * 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.writeThrowable(t);
    }
    return throwable;
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:20,代碼來源:ElasticsearchException.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalString(this.getMessage());
    out.writeThrowable(this.getCause());
    writeStackTraces(this, out);
    out.writeVInt(headers.size());
    for (Map.Entry<String, List<String>> entry : headers.entrySet()) {
        out.writeString(entry.getKey());
        out.writeVInt(entry.getValue().size());
        for (String v : entry.getValue()) {
            out.writeString(v);
        }
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:14,代碼來源:ElasticsearchException.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(version);
    out.writeLong(numDocs);
    if (storeException != null) {
        out.writeBoolean(true);
        out.writeThrowable(storeException);
    } else {
        out.writeBoolean(false);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:TransportNodesListGatewayStartedShards.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
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.writeOptionalString(message);
    out.writeThrowable(failure);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:UnassignedInfo.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    shardRouting.writeTo(out);
    out.writeString(indexUUID);
    out.writeString(message);
    out.writeString(finderNodeId);
    out.writeThrowable(failure);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:10,代碼來源:ShardStateAction.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    node.writeTo(out);
    out.writeLong(version);
    allocation.writeTo(out);
    if (storeException != null) {
        out.writeBoolean(true);
        out.writeThrowable(storeException);
    } else {
        out.writeBoolean(false);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:IndicesShardStoresResponse.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeOptionalString(type);
    out.writeString(id);
    out.writeThrowable(throwable);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:MultiGetResponse.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(items.size());
    for (Item item : items) {
        out.writeVInt(item.slot);
        if (item.response != null) {
            out.writeBoolean(true);
            item.response.writeTo(out);
        } else {
            out.writeBoolean(false);
            out.writeThrowable(item.error);
        }
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:16,代碼來源:TransportShardMultiPercolateAction.java

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    if (response != null) {
        out.writeBoolean(true);
        response.writeTo(out);
    } else {
        out.writeBoolean(false);
        out.writeThrowable(throwable);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:11,代碼來源:MultiPercolateResponse.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    if (shardTarget == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        shardTarget.writeTo(out);
    }
    out.writeString(reason);
    RestStatus.writeTo(out, status);
    out.writeThrowable(cause);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:ShardSearchFailure.java

示例13: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(nodeId);
    out.writeLong(taskId);
    out.writeThrowable(reason);
    RestStatus.writeTo(out, status);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:TaskOperationFailure.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    if (index == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeString(index);
    }
    out.writeVInt(shardId);
    out.writeThrowable(reason);
    RestStatus.writeTo(out, status);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:13,代碼來源:DefaultShardOperationFailedException.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeVInt(shardId);
    out.writeOptionalString(nodeId);
    out.writeThrowable(cause);
    RestStatus.writeTo(out, status);
    out.writeBoolean(primary);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:10,代碼來源:ActionWriteResponse.java


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