Package org.elasticsearch.action.bulk

Examples of org.elasticsearch.action.bulk.BulkResponse.buildFailureMessage()


                        } else {
                            bulkRequestBuilder.execute(new ActionListener<BulkResponse>() {
                                @Override public void onResponse(BulkResponse response) {
                                    if (response.hasFailures()) {
                                        // TODO write to exception queue?
                                        logger.warn("failed to execute" + response.buildFailureMessage());
                                    }
                                    for (Long deliveryTag : deliveryTags) {
                                        try {
                                            channel.basicAck(deliveryTag, false);
                                        } catch (IOException e1) {
View Full Code Here


                try {
                    BulkResponse response = bulk.execute().actionGet();
                    if (response.hasFailures()) {
                        // TODO write to exception queue?
                        logger.warn("failed to execute" + response.buildFailureMessage());
                    }
                } catch (Exception e) {
                    logger.warn("failed to execute bulk", e);
                }
            }
View Full Code Here

            logger.info("Executing bulk {} actions", bulk.numberOfActions());
            if (bulk.numberOfActions() > 0) {
                BulkResponse response = bulk.execute().actionGet();
                logger.info("Bulk actions tooks {} ms", response.getTookInMillis());
                if (response.hasFailures()) {
                    logger.warn("failed to execute bulk: {}", response.buildFailureMessage());
                }
            } else {
                logger.info("Sorry nothing to do");
            }
        } catch(Throwable e) {
View Full Code Here

        sinkCounter.addToEventDrainAttemptCount(size);

        BulkResponse bulkResponse = bulkRequest.execute().actionGet();
        if (bulkResponse.hasFailures()) {
          throw new EventDeliveryException(bulkResponse.buildFailureMessage());
        }
      }
      txn.commit();
      sinkCounter.addToEventDrainSuccessCount(size);
      counterGroup.incrementAndGet("transaction.success");
View Full Code Here

  @Override
  public void executeESBulkRequest(BulkRequestBuilder esBulk) throws Exception {
    BulkResponse response = esBulk.execute().actionGet();
    if (response.hasFailures()) {
      throw new ElasticsearchException("Failed to execute ES index bulk update: " + response.buildFailureMessage());
    }
  }

  @Override
  public Thread acquireIndexingThread(String threadName, Runnable runnable) {
View Full Code Here

                BulkResponse bulkResponse = bulkBuilder.execute().actionGet();

                // Handle errors
                if( bulkResponse.hasFailures() )
                {
                    throw new ElasticSearchIndexException( bulkResponse.buildFailureMessage() );
                }

                LOGGER.debug( "Indexing changed Entity states took {}ms", bulkResponse.getTookInMillis() );

                // Refresh index
View Full Code Here

                    .setOpType(opType));
        }
        final BulkResponse bulkResponse = bulkRequest.setRefresh(true)
                .execute().actionGet();
        if (bulkResponse.hasFailures()) {
            throw new RobotSystemException(bulkResponse.buildFailureMessage());
        }
    }

    protected boolean exists(final String sessionId, final String url) {
        final String id = getId(sessionId, url);
View Full Code Here

          // This is a little slower than passing in an ActionListener
          // to execute(). However, it doesn't spawn thousands of
          // zombie threads that hang out after it's done either.
          BulkResponse response = currentRequest.execute().actionGet();
          if(response.hasFailures()){
            logger.error("failed to execute" + response.buildFailureMessage());
          }
        } catch(Exception e) {
          logger.error("Failed to process bulk", e);
        }
       currentRequest = client.prepareBulk();
View Full Code Here

      if(actionCount != 0 && (actionCount > bulkSize || force == true)){
        try{
          if(logger.isDebugEnabled()) logger.debug("Executing bulk request: actionCount={} bulkSize={} force={}", actionCount, bulkSize, force);
          BulkResponse response = currentRequest.execute().actionGet();
          if(response.hasFailures()){
            logger.error("failed to execute" + response.buildFailureMessage());
          }
        } catch(Exception e) {
          logger.error("Failed to process bulk", e);
        }
        currentRequest = client.prepareBulk();
View Full Code Here

    // All docs
    result = indexManager.bulkAddDocuments(IndexManager.mapListToIndex(docset, new TypeToken<Set<DocumentPojo>>(){},
                                  new DocumentPojoIndexMap()), "_id", null, true);
    if (result.hasFailures()) {
      System.out.print("****** FAILED: ");
      System.out.println(result.buildFailureMessage());
    }
   
    //Delete index (once testing complete)
    indexManager.deleteMe();
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.