org.elasticsearch.client.Client.settings()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.1k)|赞(0)|评价(0)|浏览(174)

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

Client.settings介绍

[英]Returns this clients settings
[中]返回此客户端设置

代码示例

代码示例来源:origin: loklak/loklak_server

public Map<String, String> nodeSettings() {
  return this.elasticsearchClient.settings().getAsMap();
}

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

/**
 * Creates a new FilterClient
 *
 * @param in the client to delegate to
 * @see #in()
 */
public FilterClient(Client in) {
  this(in.settings(), in.threadPool(), in);
}

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

/**
 * Creates a new FilterClient
 *
 * @param in the client to delegate to
 * @see #in()
 */
public FilterClient(Client in) {
  this(in.settings(), in.threadPool(), in);
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

/**
 * Creates a new FilterClient
 *
 * @param in the client to delegate to
 * @see #in()
 */
public FilterClient(Client in) {
  this(in.settings(), in.threadPool(), in);
}

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

protected BulkRequestHandler(Client client) {
  this.client = client;
  this.logger = Loggers.getLogger(getClass(), client.settings());
}

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

protected BulkRequestHandler(Client client) {
  this.client = client;
  this.logger = Loggers.getLogger(getClass(), client.settings());
}

代码示例来源:origin: souyunku/SpringBootExamples

private void printElasticSearchInfo() {
  System.out.println("--ElasticSearch-->");
  Client client = es.getClient();
  Map<String, String> asMap = client.settings().getAsMap();
  asMap.forEach((k, v) -> {
    System.out.println(k + " = " + v);
  });
  System.out.println("<--ElasticSearch--");
}

代码示例来源:origin: Nasruddin/elasticsearch-spring-boot-spring-data

@GetMapping("/elastic/details")
public ResponseEntity<Map<String, String>> getElasticInformation() {
  Client client = elasticsearchOperations.getClient();
  Map<String, String> asMap = client.settings().getAsMap();
  return ResponseEntity.ok(asMap);
}

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

AbstractRetryHandler(Class<? extends Throwable> retryOnThrowable, BackoffPolicy backoffPolicy, Client client, ActionListener<BulkResponse> listener) {
  this.retryOnThrowable = retryOnThrowable;
  this.backoff = backoffPolicy.iterator();
  this.client = client;
  this.listener = listener;
  this.logger = Loggers.getLogger(getClass(), client.settings());
  // in contrast to System.currentTimeMillis(), nanoTime() uses a monotonic clock under the hood
  this.startTimestampNanos = System.nanoTime();
}

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

public AbstractRetryHandler(Class<? extends Throwable> retryOnThrowable, BackoffPolicy backoffPolicy, Client client, ActionListener<BulkResponse> listener) {
  this.retryOnThrowable = retryOnThrowable;
  this.backoff = backoffPolicy.iterator();
  this.client = client;
  this.listener = listener;
  this.logger = Loggers.getLogger(getClass(), client.settings());
  // in contrast to System.currentTimeMillis(), nanoTime() uses a monotonic clock under the hood
  this.startTimestampNanos = System.nanoTime();
}

代码示例来源:origin: cereebro/cereebro

@Override
public Set<Relationship> detect() {
  return clients.stream()
      .map(c -> Dependency.on(Component.of(c.settings().get("cluster.name"), ComponentType.ELASTIC_SEARCH)))
      .collect(Collectors.toSet());
}

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

/**
 * Creates a new FilterClient
 *
 * @param in the client to delegate to
 * @see #in()
 */
public FilterClient(Client in) {
  super(in.settings(), in.threadPool(), in.headers());
  this.in = in;
}

代码示例来源:origin: com.floragunn/search-guard

@Override
protected void doStart() throws ElasticsearchException {
  this.scheduler = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1,
      EsExecutors.daemonThreadFactory(client.settings(), "search_guard_config_service"));
  this.scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
  this.scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
  this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(new Reload(), 5, 1, TimeUnit.SECONDS);
}

代码示例来源:origin: jprante/elasticsearch-transport-websocket

BulkHandler(Settings settings, Client client, BulkHandler.Listener listener, int concurrentRequests, int bulkActions, @Nullable TimeValue flushInterval) {
  super(settings, client);
  this.listener = listener;
  this.concurrentRequests = concurrentRequests;
  this.bulkActions = bulkActions;
  this.semaphore = new Semaphore(concurrentRequests);
  this.flushInterval = flushInterval;
  if (flushInterval != null) {
    this.scheduler = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1, EsExecutors.daemonThreadFactory(client.settings(), "websocket_bulk_processor"));
    this.scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
    this.scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
    this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(new BulkHandler.Flush(), flushInterval.millis(), flushInterval.millis(), TimeUnit.MILLISECONDS);
  } else {
    this.scheduler = null;
    this.scheduledFuture = null;
  }
}

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

BulkProcessor(Client client, BackoffPolicy backoffPolicy, Listener listener, @Nullable String name, int concurrentRequests, int bulkActions, ByteSizeValue bulkSize, @Nullable TimeValue flushInterval) {
  this.bulkActions = bulkActions;
  this.bulkSize = bulkSize.getBytes();
  this.bulkRequest = new BulkRequest();
  this.bulkRequestHandler = (concurrentRequests == 0) ? BulkRequestHandler.syncHandler(client, backoffPolicy, listener) : BulkRequestHandler.asyncHandler(client, backoffPolicy, listener, concurrentRequests);
  if (flushInterval != null) {
    this.scheduler = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1, EsExecutors.daemonThreadFactory(client.settings(), (name != null ? "[" + name + "]" : "") + "bulk_processor"));
    this.scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
    this.scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
    this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(new Flush(), flushInterval.millis(), flushInterval.millis(), TimeUnit.MILLISECONDS);
  } else {
    this.scheduler = null;
    this.scheduledFuture = null;
  }
}

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

BulkProcessor(Client client, BackoffPolicy backoffPolicy, Listener listener, @Nullable String name, int concurrentRequests, int bulkActions, ByteSizeValue bulkSize, @Nullable TimeValue flushInterval) {
  this.bulkActions = bulkActions;
  this.bulkSize = bulkSize.bytes();
  this.bulkRequest = new BulkRequest();
  this.bulkRequestHandler = (concurrentRequests == 0) ? BulkRequestHandler.syncHandler(client, backoffPolicy, listener) : BulkRequestHandler.asyncHandler(client, backoffPolicy, listener, concurrentRequests);
  if (flushInterval != null) {
    this.scheduler = (ScheduledThreadPoolExecutor) Executors.newScheduledThreadPool(1, EsExecutors.daemonThreadFactory(client.settings(), (name != null ? "[" + name + "]" : "") + "bulk_processor"));
    this.scheduler.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
    this.scheduler.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
    this.scheduledFuture = this.scheduler.scheduleWithFixedDelay(new Flush(), flushInterval.millis(), flushInterval.millis(), TimeUnit.MILLISECONDS);
  } else {
    this.scheduler = null;
    this.scheduledFuture = null;
  }
}

相关文章