当前位置: 首页>>代码示例>>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;未经允许,请勿转载。