Examples of buildFailureMessage()


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

    // 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

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

            bulkRequest.add(client.prepareIndex(index, "metadata", metadata.name).setSource(json));

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

            if(bulkResponse.hasFailures()) {
                Crawler.logger.error("Elastic Search Failure: " + bulkResponse.buildFailureMessage());
            }

        } else {
            unhandled(message);
        }
View Full Code Here

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

    public void onEnd() {
        BulkResponse bulkResponse = bulkRequest.execute().actionGet();

        if(bulkResponse.hasFailures()) {
            Crawler.logger.error("Elasticsearch Failure: " + bulkResponse.buildFailureMessage());
        } else {
            Crawler.logger.info("***** " + itemCounter + " items saved in: " + index + "/" + type + "/" + id + "-[..] *****");
        }
    }

View Full Code Here

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

  @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

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

        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");
        }
    }
View Full Code Here

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

  }

  private void updateDocuments() {
    BulkResponse bulkResponse = bulkRequest.execute().actionGet();
    if(bulkResponse.hasFailures()) {
      log.error("error while bulk update: " + bulkResponse.buildFailureMessage());
    }
    this.bulkRequest = this.esClient.prepareBulk();
  }
}
View Full Code Here

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

  private void saveDocuments() {
    if(this.documentCount < 1) return;

    BulkResponse bulkResponse = bulkRequest.execute().actionGet();
    if(bulkResponse.hasFailures()) {
      log.error("error while bulk import:" + bulkResponse.buildFailureMessage());
    }
    this.bulkRequest = this.esClient.prepareBulk();
  }

  @Override
View Full Code Here

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

  @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

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

            bulkRequest.add(indexRequest);
        }
        bulkRequest.refresh(true);
        BulkResponse response = client().bulk(bulkRequest).actionGet();
        if (response.hasFailures()) {
            fail("Error in creating products: " + response.buildFailureMessage());
        }

        assertDocumentCountAfterIndexing(index, products.size() + currentCount);
    }
View Full Code Here

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

            }

            if(bulkRequest.numberOfActions() > 0) {
                BulkResponse bulkResponse = bulkRequest.execute().actionGet();
                if(bulkResponse.hasFailures()) {
                    log.error("Bulk Request Failed due to: " + bulkResponse.buildFailureMessage());
                }
            }
        }
        catch (RuntimeException re)
        {
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.