org.elasticsearch.action.WriteConsistencyLevel.fromString()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(107)

本文整理了Java中org.elasticsearch.action.WriteConsistencyLevel.fromString()方法的一些代码示例,展示了WriteConsistencyLevel.fromString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WriteConsistencyLevel.fromString()方法的具体详情如下:
包路径:org.elasticsearch.action.WriteConsistencyLevel
类名称:WriteConsistencyLevel
方法名:fromString

WriteConsistencyLevel.fromString介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

private BulkRequestBuilder initRequest() {
  BulkRequestBuilder bulkRequest = client.prepareBulk();
  bulkRequest.setConsistencyLevel( WriteConsistencyLevel.fromString( config.getWriteConsistencyLevel() ) );
  bulkRequest.setRefresh( config.isForcedRefresh() );
  return bulkRequest;
}

代码示例来源:origin: ef-labs/vertx-elasticsearch-service

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);
}

代码示例来源:origin: javanna/elasticshell

public UpdateRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) {
  request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
  return this;
}

代码示例来源:origin: javanna/elasticshell

public DeleteByQueryRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) {
  request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
  return this;
}

代码示例来源:origin: javanna/elasticshell

public IndexRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) {
  request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
  return this;
}

代码示例来源:origin: javanna/elasticshell

public DeleteRequestBuilder<JsonInput, JsonOutput> consistencyLevel(String consistencyLevel) {
  request.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
  return this;
}

代码示例来源:origin: org.elasticsearch.module/reindex

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));
  }
}

代码示例来源:origin: com.strapdata.elasticsearch.module/reindex

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));
  }
}

代码示例来源:origin: harbby/presto-connectors

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"));
}

代码示例来源:origin: medcl/elasticsearch-partialupdate

indexRequest
    .consistencyLevel(WriteConsistencyLevel
        .fromString(consistencyLevel));

代码示例来源:origin: yakaz/elasticsearch-action-updatebyquery

String consistencyLevel = request.param("consistency");
if (consistencyLevel != null) {
  udqRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

代码示例来源:origin: harbby/presto-connectors

indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

代码示例来源:origin: harbby/presto-connectors

bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

代码示例来源:origin: harbby/presto-connectors

String consistencyLevel = request.param("consistency");
if (consistencyLevel != null) {
  updateRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

代码示例来源:origin: harbby/presto-connectors

deleteRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

代码示例来源:origin: mattweber/elasticsearch-mocksolrplugin

indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));

相关文章