Module org.elasticsearch.server
Class AcknowledgedResponse
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.support.master.AcknowledgedResponse
- All Implemented Interfaces:
IsAcknowledgedSupplier
,Writeable
,RefCounted
,ToXContent
,ToXContentObject
- Direct Known Subclasses:
ClusterUpdateSettingsResponse
,ShardsAcknowledgedResponse
public class AcknowledgedResponse
extends ActionResponse
implements IsAcknowledgedSupplier, ToXContentObject
A response to an action which updated the cluster state, but needs to report whether any relevant nodes failed to apply the update. For
instance, a
PutMappingRequest
may update a mapping in the index metadata, but
one or more data nodes may fail to acknowledge the new mapping within the ack timeout. If this happens then clients must accept that
subsequent requests that rely on the mapping update may return errors from the lagging data nodes.
Actions which return a payload-free acknowledgement of success should generally prefer to use ActionResponse.Empty
instead of
AcknowledgedResponse
, and other listeners should generally prefer Void
.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
static final String
static final AcknowledgedResponse
static final AcknowledgedResponse
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCustomFields
(XContentBuilder builder, ToXContent.Params params) protected static <T extends AcknowledgedResponse>
voiddeclareAcknowledgedField
(ConstructingObjectParser<T, Void> objectParser) boolean
static AcknowledgedResponse
fromXContent
(XContentParser parser) int
hashCode()
final boolean
static AcknowledgedResponse
of
(boolean acknowledged) static AcknowledgedResponse
readFrom
(StreamInput in) final XContentBuilder
toXContent
(XContentBuilder builder, ToXContent.Params params) void
writeTo
(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRef
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Field Details
-
TRUE
-
FALSE
-
ACKNOWLEDGED_KEY
- See Also:
-
acknowledged
protected final boolean acknowledged
-
-
Constructor Details
-
AcknowledgedResponse
- Throws:
IOException
-
AcknowledgedResponse
protected AcknowledgedResponse(boolean acknowledged)
-
-
Method Details
-
declareAcknowledgedField
protected static <T extends AcknowledgedResponse> void declareAcknowledgedField(ConstructingObjectParser<T, Void> objectParser) -
readFrom
- Throws:
IOException
-
of
-
isAcknowledged
public final boolean isAcknowledged()- Specified by:
isAcknowledged
in interfaceIsAcknowledgedSupplier
- Returns:
- whether the update was acknowledged by all the relevant nodes in the cluster.
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Throws:
IOException
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContent
in interfaceToXContent
- Throws:
IOException
-
addCustomFields
protected void addCustomFields(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
fromXContent
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-