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,IndicesAliasesResponse,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.EmptyNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanstatic final Stringstatic final AcknowledgedResponsestatic final AcknowledgedResponseFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCustomFields(XContentBuilder builder, ToXContent.Params params) static <T extends AcknowledgedResponse>
voiddeclareAcknowledgedField(ConstructingObjectParser<T, Void> objectParser) booleanstatic AcknowledgedResponsefromXContent(XContentParser parser) inthashCode()final booleanstatic AcknowledgedResponseof(boolean acknowledged) static AcknowledgedResponsereadFrom(StreamInput in) final XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods 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
public static <T extends AcknowledgedResponse> void declareAcknowledgedField(ConstructingObjectParser<T, Void> objectParser) -
readFrom
- Throws:
IOException
-
of
-
isAcknowledged
public final boolean isAcknowledged()- Specified by:
isAcknowledgedin interfaceIsAcknowledgedSupplier- Returns:
- whether the update was acknowledged by all the relevant nodes in the cluster.
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public final XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
addCustomFields
protected void addCustomFields(XContentBuilder builder, ToXContent.Params params) throws IOException - Throws:
IOException
-
fromXContent
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-