Send bulk data async.

@param bulkSourceList the bulk source list
@param index          the index
@param type           the type
353878
public void sendBulkDataAsync(List<? extends Map<String, ?>> bulkSourceList,
            String index, String type) {
        executeBulkRequestAsync(
                buildBulkIndexRequestBuilder(bulkSourceList
                        .stream().map(source -> jmESClient
                                .prepareIndex(index, type).setSource(source))
                        .collect(toList())));
    }
1312216
public SearchResponse searchAll(String index, String type,
            AggregationBuilder[] aggregationBuilders) {
        return searchAll(index, type, null, aggregationBuilders);
    }
107548
public void deleteBulkDocsAsync(String index, String type) {
        executeBulkRequestAsync(buildDeleteBulkRequestBuilder(
                buildAllDeleteRequestBuilderList(index, type)));
    }
1255348
public void write(final AbstractIndex index)
		throws IOException
	{

		StringBuilder cmd;

		while (index.size() > 0) {

			System.out.println("Transmit Index [" + index + "]");

			cmd = index.remove();

			if(index instanceof ArticleIndex){
				articleIdxWriter.write(cmd.toString());
			}else if(index instanceof ChronoIndex){
				chronoIdxWriter.write(cmd.toString());
			}else if(index instanceof RevisionIndex){
				revisionIdxWriter.write(cmd.toString());
			}

		}

		if(index instanceof ArticleIndex){
			articleIdxWriter.flush();
		}else if(index instanceof ChronoIndex){
			chronoIdxWriter.flush();
		}else if(index instanceof RevisionIndex){
			revisionIdxWriter.flush();
		}
	}
124549
public void setType (int index, String type)
    {
    if (index >= 0 && index < length) {
        data[index*5+3] = type;
    } else {
        badIndex(index);
    }
    }
1109711
@SuppressWarnings("unchecked")
	@Override
	public <E> int bulkInsert(final Class<E> entityType, final Stream<E> entities,
			final InsertsCondition<? super E> condition) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);
			SqlContext context = handler.createBulkInsertContext(this, metadata, entityType);
			context.setSqlKind(SqlKind.BULK_INSERT);

			// IDアノテーションが付与されたカラム情報を取得する
			MappingColumn[] idColumns = MappingUtils.getIdMappingColumns(entityType);

			setGeneratedKeyColumns(context, idColumns, metadata);

			int frameCount = 0;
			int count = 0;
			List<E> entityList = new ArrayList<>();
			for (Iterator<E> iterator = entities.iterator(); iterator.hasNext();) {
				E entity = iterator.next();

				if (!entityType.isInstance(entity)) {
					throw new IllegalArgumentException("Entity types do not match");
				}

				entityList.add(entity);

				handler.setBulkInsertParams(context, entity, frameCount);
				frameCount++;

				if (condition.test(context, frameCount, entity)) {
					count += doBulkInsert(context, entityType, handler, metadata, idColumns, entityList);
					frameCount = 0;
					entityList.clear();

					// 新しいSqlContextを作成する前にgeneratedKeyColumnsを退避しておく
					String[] generatedKeyColumns = context.getGeneratedKeyColumns();
					context = handler.createBulkInsertContext(this, metadata, entityType);
					context.setSqlKind(SqlKind.BULK_INSERT);
					// 実行結果から生成されたIDを取得できるようにPreparedStatementにIDカラムを渡す
					context.setGeneratedKeyColumns(generatedKeyColumns);
				}
			}
			return count + (frameCount > 0 ? doBulkInsert(context, entityType, handler, metadata, idColumns, entityList)
					: 0);

		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.BULK_INSERT, e);
		}
	}
109848
def send_bulk(data, tag, chunk, bulk_message_count, extracted_values, info)
      begin

        log.on_trace { log.trace "bulk request: #{data}" }
        response = client(info.host).bulk body: data, index: info.index
        log.on_trace { log.trace "bulk response: #{response}" }

        if response['errors']
          error = Fluent::Plugin::ElasticsearchErrorHandler.new(self)
          error.handle_error(response, tag, chunk, bulk_message_count, extracted_values)
        end
      rescue RetryStreamError => e
        emit_tag = @retry_tag ? @retry_tag : tag
        router.emit_stream(emit_tag, e.retry_stream)
      rescue => e
        ignore = @ignore_exception_classes.any? { |clazz| e.class <= clazz }

        log.warn "Exception ignored in tag #{tag}: #{e.class.name} #{e.message}" if ignore

        @_es = nil if @reconnect_on_error
        @_es_info = nil if @reconnect_on_error

        raise UnrecoverableRequestFailure if ignore && @exception_backup

        # FIXME: identify unrecoverable errors and raise UnrecoverableRequestFailure instead
        raise RecoverableRequestFailure, "could not push logs to Elasticsearch cluster (#{connection_options_description(info.host)}): #{e.message}" unless ignore
      end
    end
567262
public IndexResponse sendDataWithObjectMapper(Object sourceObject,
            String index, String type, String id) {
        return sendData(
                JMElasticsearchUtil.buildSourceByJsonMapper(sourceObject),
                index, type, id);
    }
915080
public <T> ESDatas<T> searchAllParallel(String index,  Class<T> type,int thread) throws ElasticSearchException{
			return searchAllParallel(index,  ClientInterface.DEFAULT_FETCHSIZE,type,thread);
	}
1105391
public function populateIndex(BulkOperation $bulk, databox $databox)
    {
        $this->logger->info(sprintf('Indexing database %s...', $databox->get_viewname()));

        $submitted_records = [];
        // No delegate, scan all records
        $fetcher = $this->fetcherFactory->createFetcher($databox);

        // post fetch : flag records as "indexing"
        $fetcher->setPostFetch(function(array $records) use ($databox, $fetcher) {
            RecordQueuer::didStartIndexingRecords($records, $databox);
            // do not restart the fetcher since it has no clause on jetons
        });

        // bulk flush : flag records as "indexed"
        $bulk->onFlush(function($operation_identifiers) use ($databox, &$submitted_records) {
            $this->onBulkFlush($databox, $operation_identifiers, $submitted_records);
        });

        // Perform indexing
        $this->indexFromFetcher($bulk, $fetcher, $submitted_records);

        $this->logger->info(sprintf('Finished indexing %s', $databox->get_viewname()));
    }
489441
private <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type, String callLocationName) {
		return new DataSource<>(this, new ParallelIteratorInputFormat<>(iterator), type, callLocationName);
	}
1231873
function (oRequest) {
			if (!!this.options.datasource) {
				this.options.datasource.sendRequest(oRequest, {success: this.onDatasourceSuccess, failure: this.onDatasourceFailure, scope: this});
			}
		}
360964
public ActionFuture<IndexResponse> sendDataAsync(
            Map<String, ?> source, String index, String type, String id) {
        return indexQueryAsync(buildIndexRequest(source, index, type, id));
    }
1126608
public String sendData(String jsonSource, String index, String type) {
        return sendData(jsonSource, index, type, null).getId();
    }
1139832
public IndexResponse sendData(Map<String, ?> source, String index,
            String type, String id) {
        return indexQuery(buildIndexRequest(source, index, type, id));
    }
54165
public function addIndex($type, $index)
    {
        if (!isset($this->indexes[$type])) {
            $this->indexes[$type] = [];
        }

        $this->indexes[$type][] = $index;
    }
385840
private void indexEntity(String type, String id, XContentBuilder sourceEntity) throws StorageException {
        indexEntity(type, id, sourceEntity, false);
    }