当前位置: 首页>>代码示例>>Java>>正文


Java BulkProcessor.builder方法代码示例

本文整理汇总了Java中org.elasticsearch.action.bulk.BulkProcessor.builder方法的典型用法代码示例。如果您正苦于以下问题:Java BulkProcessor.builder方法的具体用法?Java BulkProcessor.builder怎么用?Java BulkProcessor.builder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.action.bulk.BulkProcessor的用法示例。


在下文中一共展示了BulkProcessor.builder方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBulkProcessor

import org.elasticsearch.action.bulk.BulkProcessor; //导入方法依赖的package包/类
public BulkProcessor getBulkProcessor(Client client, BulkProcessor.Listener listener) {
  BulkProcessor.Builder builder = BulkProcessor.builder(client, listener);

  // Concurrent requests set to 0 to ensure ordering of documents is maintained in batches.
  // This also means BulkProcessor#flush() is blocking as is also required.
  builder.setConcurrentRequests(0);

  if (config.getBulkFlushMaxActions().isPresent()) {
    builder.setBulkActions(config.getBulkFlushMaxActions().get());
  }
  if (config.getBulkFlushMaxSizeMB().isPresent()) {
    builder.setBulkSize(new ByteSizeValue(config.getBulkFlushMaxSizeMB().get(), ByteSizeUnit.MB));
  }
  if (config.getBulkFlushIntervalMS().isPresent()) {
    builder.setFlushInterval(TimeValue.timeValueMillis(config.getBulkFlushIntervalMS().get()));
  }

  return builder.build();
}
 
开发者ID:apache,项目名称:samza,代码行数:20,代码来源:BulkProcessorFactory.java

示例2: buildBulkProcessor

import org.elasticsearch.action.bulk.BulkProcessor; //导入方法依赖的package包/类
/**
 * Build the {@link BulkProcessor}.
 *
 * <p>Note: this is exposed for testing purposes.
 */
@VisibleForTesting
protected BulkProcessor buildBulkProcessor(BulkProcessor.Listener listener) {
	checkNotNull(listener);

	BulkProcessor.Builder bulkProcessorBuilder = BulkProcessor.builder(client, listener);

	// This makes flush() blocking
	bulkProcessorBuilder.setConcurrentRequests(0);

	if (bulkProcessorFlushMaxActions != null) {
		bulkProcessorBuilder.setBulkActions(bulkProcessorFlushMaxActions);
	}

	if (bulkProcessorFlushMaxSizeMb != null) {
		bulkProcessorBuilder.setBulkSize(new ByteSizeValue(bulkProcessorFlushMaxSizeMb, ByteSizeUnit.MB));
	}

	if (bulkProcessorFlushIntervalMillis != null) {
		bulkProcessorBuilder.setFlushInterval(TimeValue.timeValueMillis(bulkProcessorFlushIntervalMillis));
	}

	// if backoff retrying is disabled, bulkProcessorFlushBackoffPolicy will be null
	callBridge.configureBulkProcessorBackoff(bulkProcessorBuilder, bulkProcessorFlushBackoffPolicy);

	return bulkProcessorBuilder.build();
}
 
开发者ID:axbaretto,项目名称:flink,代码行数:32,代码来源:ElasticsearchSinkBase.java

示例3: getBulkProcessorBuilder

import org.elasticsearch.action.bulk.BulkProcessor; //导入方法依赖的package包/类
/**
 * Gets the bulk processor builder.
 *
 * @param bulkProcessorListener
 *            the bulk processor listener
 * @param bulkActions
 *            the bulk actions
 * @param byteSizeValue
 *            the byte size value
 * @param flushInterval
 *            the flush interval
 * @param concurrentRequests
 *            the concurrent requests
 * @param backoffPolicy
 *            the backoff policy
 * @return the bulk processor builder
 */
public Builder getBulkProcessorBuilder(Listener bulkProcessorListener,
		Integer bulkActions, ByteSizeValue byteSizeValue,
		TimeValue flushInterval, Integer concurrentRequests,
		BackoffPolicy backoffPolicy) {
	Builder builder =
			BulkProcessor.builder(jmESClient, bulkProcessorListener);
	ifNotNull(bulkActions, builder::setBulkActions);
	ifNotNull(byteSizeValue, builder::setBulkSize);
	ifNotNull(flushInterval, builder::setFlushInterval);
	ifNotNull(concurrentRequests, builder::setConcurrentRequests);
	ifNotNull(backoffPolicy, builder::setBackoffPolicy);
	return builder;
}
 
开发者ID:JM-Lab,项目名称:utils-elasticsearch,代码行数:31,代码来源:JMElasticsearchBulk.java


注:本文中的org.elasticsearch.action.bulk.BulkProcessor.builder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。