本文整理汇总了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);
}
}
示例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);
}
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}