public abstract class DocWriteResponse extends ReplicationResponse implements WriteResponse, StatusToXContent
ReplicationResponse.ShardInfo
TransportResponse.Empty
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
DocWriteResponse() |
|
DocWriteResponse(ShardId shardId,
java.lang.String type,
java.lang.String id,
long version) |
Modifier and Type | Method and 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.
|
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.
|
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
ShardInfo#status() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
getShardInfo, setShardInfo
remoteAddress, remoteAddress
public DocWriteResponse(ShardId shardId, java.lang.String type, java.lang.String id, long version)
protected DocWriteResponse()
public java.lang.String getIndex()
public ShardId getShardId()
public java.lang.String getType()
public java.lang.String getId()
public long getVersion()
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)
WriteResponse
WriteRequest.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 WriteResponse
public RestStatus status()
ShardInfo#status()
status
in interface StatusToXContent
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class ReplicationResponse
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class ReplicationResponse
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException