private BulkRequestBuilder initRequest() { BulkRequestBuilder bulkRequest = client.prepareBulk(); bulkRequest.setConsistencyLevel( WriteConsistencyLevel.fromString( config.getWriteConsistencyLevel() ) ); bulkRequest.setRefresh( config.isForcedRefresh() ); return bulkRequest; }
protected AbstractWriteOptions(JsonObject json) { super(json); timeout = json.getString(FIELD_TIMEOUT); String s = json.getString(FIELD_CONSISTENCY_LEVEL); if (s != null) consistencyLevel = WriteConsistencyLevel.fromString(s); }
public UpdateRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) { request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel)); return this; }
public DeleteByQueryRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) { request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel)); return this; }
public IndexRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) { request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel)); return this; }
public DeleteRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) { request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel)); return this; }
public static void parseCommon(AbstractBulkByScrollRequest<?> internalRequest, RestRequest request) { internalRequest.setRefresh(request.paramAsBoolean("refresh", internalRequest.isRefresh())); internalRequest.setTimeout(request.paramAsTime("timeout", internalRequest.getTimeout())); String consistency = request.param("consistency"); if (consistency != null) { internalRequest.setConsistency(WriteConsistencyLevel.fromString(consistency)); } }
public static void parseCommon(AbstractBulkByScrollRequest<?> internalRequest, RestRequest request) { internalRequest.setRefresh(request.paramAsBoolean("refresh", internalRequest.isRefresh())); internalRequest.setTimeout(request.paramAsTime("timeout", internalRequest.getTimeout())); String consistency = request.param("consistency"); if (consistency != null) { internalRequest.setConsistency(WriteConsistencyLevel.fromString(consistency)); } }
protected TransportReplicationAction(Settings settings, String actionName, TransportService transportService, ClusterService clusterService, IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction, MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Class<Request> request, Class<ReplicaRequest> replicaRequest, String executor) { super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager()); this.transportService = transportService; this.clusterService = clusterService; this.indicesService = indicesService; this.shardStateAction = shardStateAction; this.mappingUpdatedAction = mappingUpdatedAction; this.transportPrimaryAction = actionName + "[p]"; this.transportReplicaAction = actionName + "[r]"; this.executor = executor; this.checkWriteConsistency = checkWriteConsistency(); transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, new OperationTransportHandler()); transportService.registerRequestHandler(transportPrimaryAction, request, executor, new PrimaryOperationTransportHandler()); // we must never reject on because of thread pool capacity on replicas transportService.registerRequestHandler(transportReplicaAction, replicaRequest, executor, true, true, new ReplicaOperationTransportHandler()); this.transportOptions = transportOptions(); this.defaultWriteConsistencyLevel = WriteConsistencyLevel.fromString(settings.get("action.write_consistency", "quorum")); }
indexRequest .consistencyLevel(WriteConsistencyLevel .fromString(consistencyLevel));
String consistencyLevel = request.param("consistency"); if (consistencyLevel != null) { udqRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
String consistencyLevel = request.param("consistency"); if (consistencyLevel != null) { updateRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
deleteRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));