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