public class DeleteRequest extends ReplicatedWriteRequest<DeleteRequest> implements DocWriteRequest<DeleteRequest>, CompositeIndicesRequest
Requests.deleteRequest(String).
The operation requires the ReplicationRequest.index(), type(String) and id(String) to
be set.
TransportRequest.EmptyDocWriteRequest.OpTypeIndicesRequest.ReplaceableWriteRequest.RefreshPolicyDEFAULT_TIMEOUT, index, shardId, timeout, waitForActiveShards| Constructor and Description |
|---|
DeleteRequest() |
DeleteRequest(java.lang.String index)
Constructs a new delete request against the specified index.
|
DeleteRequest(java.lang.String index,
java.lang.String type,
java.lang.String id)
Constructs a new delete request against the specified index with the type and id.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
id()
The id of the document to delete.
|
DeleteRequest |
id(java.lang.String id)
Sets the id of the document to delete.
|
DocWriteRequest.OpType |
opType()
Get the requested document operation type of the request
|
java.lang.String |
parent()
Get the parent for this request
|
DeleteRequest |
parent(java.lang.String parent)
Sets the parent id of this document.
|
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
java.lang.String |
routing()
Controls the shard routing of the delete request.
|
DeleteRequest |
routing(java.lang.String routing)
Controls the shard routing of the request.
|
DeleteRequest |
setShardId(ShardId shardId)
Override this method from ReplicationAction, this is where we are storing our state in the request object (which we really shouldn't
do).
|
java.lang.String |
toString() |
java.lang.String |
type()
The type of the document to delete.
|
DeleteRequest |
type(java.lang.String type)
Sets the type of the document to delete.
|
ActionRequestValidationException |
validate() |
long |
version()
Get the document version for this request
|
DeleteRequest |
version(long version)
Sets the version, which will perform the operation only if a matching
version exists and no changes happened on the doc since then.
|
VersionType |
versionType()
Get the document version type for this request
|
DeleteRequest |
versionType(VersionType versionType)
Sets the versioning type.
|
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
getRefreshPolicy, setRefreshPolicycreateTask, getDescription, index, index, indices, indicesOptions, onRetry, shardId, timeout, timeout, timeout, waitForActiveShards, waitForActiveShards, waitForActiveShardsgetShouldStoreResultgetParentTask, setParentTaskremoteAddress, remoteAddressclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitindex, indicesOptions, readDocumentRequest, writeDocumentRequestindicessetRefreshPolicysetParentTaskpublic DeleteRequest()
public DeleteRequest(java.lang.String index)
type(String) and id(String)
must be set.public DeleteRequest(java.lang.String index,
java.lang.String type,
java.lang.String id)
index - The index to get the document fromtype - The type of the documentid - The id of the documentpublic ActionRequestValidationException validate()
validate in interface WriteRequest<DeleteRequest>validate in class ReplicationRequest<DeleteRequest>public java.lang.String type()
type in interface DocWriteRequest<DeleteRequest>public DeleteRequest type(java.lang.String type)
public java.lang.String id()
id in interface DocWriteRequest<DeleteRequest>public DeleteRequest id(java.lang.String id)
public java.lang.String parent()
DocWriteRequestparent in interface DocWriteRequest<DeleteRequest>public DeleteRequest parent(java.lang.String parent)
public DeleteRequest routing(java.lang.String routing)
routing in interface DocWriteRequest<DeleteRequest>public java.lang.String routing()
routing in interface DocWriteRequest<DeleteRequest>public DeleteRequest version(long version)
DocWriteRequestversion in interface DocWriteRequest<DeleteRequest>public long version()
DocWriteRequestversion in interface DocWriteRequest<DeleteRequest>public DeleteRequest versionType(VersionType versionType)
DocWriteRequestVersionType.INTERNAL.versionType in interface DocWriteRequest<DeleteRequest>public VersionType versionType()
DocWriteRequestversionType in interface DocWriteRequest<DeleteRequest>public DocWriteRequest.OpType opType()
DocWriteRequestopType in interface DocWriteRequest<DeleteRequest>DocWriteRequest.OpTypepublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class ReplicatedWriteRequest<DeleteRequest>java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in class ReplicatedWriteRequest<DeleteRequest>java.io.IOExceptionpublic java.lang.String toString()
toString in class ReplicationRequest<DeleteRequest>public DeleteRequest setShardId(ShardId shardId)
setShardId in class ReplicationRequest<DeleteRequest>