当前位置: 首页>>代码示例>>Java>>正文


Java StreamOutput.writeException方法代码示例

本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeException方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeException方法的具体用法?Java StreamOutput.writeException怎么用?Java StreamOutput.writeException使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeException方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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.writeException(t);
    }
    return throwable;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:ElasticsearchException.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // legacy version
        out.writeLong(-1L);
    }
    out.writeOptionalString(allocationId);
    out.writeBoolean(primary);
    if (storeException != null) {
        out.writeBoolean(true);
        out.writeException(storeException);
    } else {
        out.writeBoolean(false);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:TransportNodesListGatewayStartedShards.java

示例3: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    node.writeTo(out);
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // legacy version
        out.writeLong(-1L);
    }
    out.writeOptionalString(allocationId);
    allocationStatus.writeTo(out);
    if (storeException != null) {
        out.writeBoolean(true);
        out.writeException(storeException);
    } else {
        out.writeBoolean(false);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:IndicesShardStoresResponse.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeException(reason);
    out.writeOptionalString(index);
    out.writeOptionalVInt(shardId);
    out.writeOptionalString(nodeId);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:ScrollableHitSource.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalString(this.getMessage());
    out.writeException(this.getCause());
    writeStackTraces(this, out);
    if (out.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        out.writeMapOfLists(headers, StreamOutput::writeString, StreamOutput::writeString);
        out.writeMapOfLists(metadata, StreamOutput::writeString, StreamOutput::writeString);
    } else {
        HashMap<String, List<String>> finalHeaders = new HashMap<>(headers.size() + metadata.size());
        finalHeaders.putAll(headers);
        finalHeaders.putAll(metadata);
        out.writeMapOfLists(finalHeaders, StreamOutput::writeString, StreamOutput::writeString);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:16,代码来源:ElasticsearchException.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.writeBoolean(delayed);
    out.writeOptionalString(message);
    out.writeException(failure);
    out.writeVInt(failedAllocations);
    lastAllocationStatus.writeTo(out);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:UnassignedInfo.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeBoolean(inSync);
    out.writeOptionalString(allocationId);
    out.writeLong(matchingBytes);
    out.writeException(storeException);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:NodeAllocationResult.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@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);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:ShardStateAction.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.writeException(exception);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:MultiGetResponse.java

示例10: 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.writeException(cause);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:ShardSearchFailure.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.writeException(exception);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:MultiSearchResponse.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(nodeId);
    out.writeLong(taskId);
    out.writeException(reason);
    RestStatus.writeTo(out, status);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TaskOperationFailure.java

示例13: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    shardId.writeTo(out);
    out.writeOptionalString(nodeId);
    out.writeException(cause);
    RestStatus.writeTo(out, status);
    out.writeBoolean(primary);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:ReplicationResponse.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.writeException(reason);
    RestStatus.writeTo(out, status);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:13,代码来源:DefaultShardOperationFailedException.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(getIndex());
    out.writeString(getType());
    out.writeOptionalString(getId());
    out.writeException(getCause());
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:BulkItemResponse.java


注:本文中的org.elasticsearch.common.io.stream.StreamOutput.writeException方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。