WriteResponse, Streamable, Writeable, StatusToXContentObject, ToXContent, ToXContentObjectDeleteResponse, IndexResponse, UpdateResponsepublic abstract class DocWriteResponse extends ReplicationResponse implements WriteResponse, StatusToXContentObject
| Modifier and Type | Class | Description |
|---|---|---|
static class |
DocWriteResponse.Builder |
Base class of all
DocWriteResponse builders. |
static class |
DocWriteResponse.Result |
An enum that represents the results of CRUD operations, primarily used to communicate the type of
operation that occurred.
|
ReplicationResponse.ShardInfoToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsTransportResponse.EmptyWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
protected DocWriteResponse.Result |
result |
EMPTYEMPTY_PARAMS| Modifier | Constructor | Description |
|---|---|---|
protected |
DocWriteResponse() |
|
|
DocWriteResponse(ShardId shardId,
java.lang.String type,
java.lang.String id,
long seqNo,
long primaryTerm,
long version,
DocWriteResponse.Result result) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
forcedRefresh() |
Did this request force a refresh? Requests that set
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE will always return true for this. |
java.lang.String |
getId() |
The id of the document changed.
|
java.lang.String |
getIndex() |
The index the document was changed in.
|
java.lang.String |
getLocation(java.lang.String routing) |
Return the relative URI for the location of the document suitable for use in the
Location header. |
long |
getPrimaryTerm() |
The primary term for this change.
|
DocWriteResponse.Result |
getResult() |
The change that occurred to the document.
|
long |
getSeqNo() |
Returns the sequence number assigned for this change.
|
ShardId |
getShardId() |
The exact shard the document was changed in.
|
java.lang.String |
getType() |
The type of the document changed.
|
long |
getVersion() |
Returns the current version of the doc.
|
XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
|
protected static void |
parseInnerToXContent(XContentParser parser,
DocWriteResponse.Builder context) |
Parse the output of the
innerToXContent(XContentBuilder, Params) method. |
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
void |
setForcedRefresh(boolean forcedRefresh) |
Mark the response as having forced a refresh? Requests that set
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE should always mark this as true. |
RestStatus |
status() |
returns the rest status for this response (based on
ReplicationResponse.ShardInfo.status() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetShardInfo, setShardInfonewWriteableReaderisFragmentremoteAddress, remoteAddressprotected DocWriteResponse.Result result
public DocWriteResponse(ShardId shardId, java.lang.String type, java.lang.String id, long seqNo, long primaryTerm, long version, DocWriteResponse.Result result)
protected DocWriteResponse()
public DocWriteResponse.Result getResult()
public java.lang.String getIndex()
public ShardId getShardId()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
public long getSeqNo()
SequenceNumbers.UNASSIGNED_SEQ_NO if the operation
wasn't performed (i.e., an update operation that resulted in a NOOP).public long getPrimaryTerm()
public boolean forcedRefresh()
WriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE will always return true for this. Requests that set it to WriteRequest.RefreshPolicy.WAIT_UNTIL will
only return true here if they run out of refresh listener slots (see IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD).public void setForcedRefresh(boolean forcedRefresh)
WriteResponseWriteRequest.setRefreshPolicy(RefreshPolicy) to
WriteRequest.RefreshPolicy.IMMEDIATE should always mark this as true. Requests that set it to WriteRequest.RefreshPolicy.WAIT_UNTIL will only
set this to true if they run out of refresh listener slots (see IndexSettings.MAX_REFRESH_LISTENERS_PER_SHARD).setForcedRefresh in interface WriteResponsepublic RestStatus status()
ReplicationResponse.ShardInfo.status()status in interface StatusToXContentObjectpublic java.lang.String getLocation(@Nullable java.lang.String routing)
Location header. The use of relative URIs is
permitted as of HTTP/1.1 (cf. https://tools.ietf.org/html/rfc7231#section-7.1.2).routing - custom routing or null if custom routing is not usedpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ReplicationResponsejava.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in interface WriteablewriteTo in class ReplicationResponsejava.io.IOExceptionpublic final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContentjava.io.IOExceptionpublic XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
java.io.IOExceptionprotected static void parseInnerToXContent(XContentParser parser, DocWriteResponse.Builder context) throws java.io.IOException
innerToXContent(XContentBuilder, Params) method.
This method is intended to be called by subclasses and must be called multiple times to parse all the information concerning
DocWriteResponse objects. It always parses the current token, updates the given parsing context accordingly
if needed and then immediately returns.java.io.IOException