public class BulkRequestBuilder extends ActionRequestBuilder<BulkRequest,BulkResponse,BulkRequestBuilder,Client>
IndexRequest
s and DeleteRequest
s and allows to executes
it in a single batch.client, request
Constructor and Description |
---|
BulkRequestBuilder(Client client) |
Modifier and Type | Method and Description |
---|---|
BulkRequestBuilder |
add(byte[] data,
int from,
int length,
boolean contentUnsafe)
Adds a framed data in binary format
|
BulkRequestBuilder |
add(byte[] data,
int from,
int length,
boolean contentUnsafe,
String defaultIndex,
String defaultType)
Adds a framed data in binary format
|
BulkRequestBuilder |
add(DeleteRequest request)
Adds an
DeleteRequest to the list of actions to execute. |
BulkRequestBuilder |
add(DeleteRequestBuilder request)
Adds an
DeleteRequest to the list of actions to execute. |
BulkRequestBuilder |
add(IndexRequest request)
Adds an
IndexRequest to the list of actions to execute. |
BulkRequestBuilder |
add(IndexRequestBuilder request)
Adds an
IndexRequest to the list of actions to execute. |
BulkRequestBuilder |
add(UpdateRequest request)
Adds an
DeleteRequest to the list of actions to execute. |
BulkRequestBuilder |
add(UpdateRequestBuilder request)
Adds an
DeleteRequest to the list of actions to execute. |
protected void |
doExecute(ActionListener<BulkResponse> listener) |
int |
numberOfActions()
The number of actions currently in the bulk.
|
BulkRequestBuilder |
setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
Sets the consistency level.
|
BulkRequestBuilder |
setRefresh(boolean refresh)
Should a refresh be executed post this bulk operation causing the operations to
be searchable.
|
BulkRequestBuilder |
setReplicationType(ReplicationType replicationType)
Set the replication type for this operation.
|
BulkRequestBuilder |
setTimeout(String timeout)
A timeout to wait if the index operation can't be performed immediately.
|
BulkRequestBuilder |
setTimeout(TimeValue timeout)
A timeout to wait if the index operation can't be performed immediately.
|
execute, execute, get, get, get, putHeader, request, setListenerThreaded
public BulkRequestBuilder(Client client)
public BulkRequestBuilder add(IndexRequest request)
IndexRequest
to the list of actions to execute. Follows the same behavior of IndexRequest
(for example, if no id is provided, one will be generated, or usage of the create flag).public BulkRequestBuilder add(IndexRequestBuilder request)
IndexRequest
to the list of actions to execute. Follows the same behavior of IndexRequest
(for example, if no id is provided, one will be generated, or usage of the create flag).public BulkRequestBuilder add(DeleteRequest request)
DeleteRequest
to the list of actions to execute.public BulkRequestBuilder add(DeleteRequestBuilder request)
DeleteRequest
to the list of actions to execute.public BulkRequestBuilder add(UpdateRequest request)
DeleteRequest
to the list of actions to execute.public BulkRequestBuilder add(UpdateRequestBuilder request)
DeleteRequest
to the list of actions to execute.public BulkRequestBuilder add(byte[] data, int from, int length, boolean contentUnsafe) throws Exception
Exception
public BulkRequestBuilder add(byte[] data, int from, int length, boolean contentUnsafe, @Nullable String defaultIndex, @Nullable String defaultType) throws Exception
Exception
public BulkRequestBuilder setReplicationType(ReplicationType replicationType)
public BulkRequestBuilder setConsistencyLevel(WriteConsistencyLevel consistencyLevel)
WriteConsistencyLevel.DEFAULT
.public BulkRequestBuilder setRefresh(boolean refresh)
public final BulkRequestBuilder setTimeout(TimeValue timeout)
public final BulkRequestBuilder setTimeout(String timeout)
public int numberOfActions()
protected void doExecute(ActionListener<BulkResponse> listener)
doExecute
in class ActionRequestBuilder<BulkRequest,BulkResponse,BulkRequestBuilder,Client>
Copyright © 2009–2015. All rights reserved.