/** * 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); if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) { seqNo = in.readZLong(); } else { seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO; } if (supportsAbortedFlag(in.getVersion())) { aborted = in.readBoolean(); } else { aborted = false; } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(getIndex()); out.writeString(getType()); out.writeOptionalString(getId()); out.writeException(getCause()); if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) { out.writeZLong(getSeqNo()); } if (supportsAbortedFlag(out.getVersion())) { out.writeBoolean(aborted); } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(getIndex()); out.writeString(getType()); out.writeOptionalString(getId()); out.writeException(getCause()); if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) { out.writeZLong(getSeqNo()); } if (supportsAbortedFlag(out.getVersion())) { out.writeBoolean(aborted); } }
/** * 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); if (in.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) { seqNo = in.readZLong(); } else { seqNo = SequenceNumbers.UNASSIGNED_SEQ_NO; } if (supportsAbortedFlag(in.getVersion())) { aborted = in.readBoolean(); } else { aborted = false; } }
@Override public void writeTo(StreamOutput out) throws IOException { out.writeString(getIndex()); out.writeString(getType()); out.writeOptionalString(getId()); out.writeException(getCause()); if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) { out.writeZLong(getSeqNo()); } if (supportsAbortedFlag(out.getVersion())) { out.writeBoolean(aborted); } }