Examples of numberOfActions()


Examples of com.dotcms.repackage.org.elasticsearch.action.bulk.BulkRequestBuilder.numberOfActions()

                    if(deps)
                        contentToIndex.addAll(loadDeps(content));
                   
                    indexContentletList(req, contentToIndex,reindexOnly);
                                       
                    if(bulk==null && req.numberOfActions()>0)
                        req.execute().actionGet();

                } catch (Exception e) {
                    Logger.error(ESContentFactoryImpl.class, e.getMessage(), e);
                }
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.bulk.BulkRequestBuilder.numberOfActions()

                    String json = raw.substring(delimidx + JSON_RECORD_DELIMITER.length(), raw.length());
                    if (id != null)
                        req.add(new IndexRequest(index, type, id).source(json));
                  }
              }
                if(req.numberOfActions()>0) {
                    req.execute().actionGet();
                    //client.admin().indices().flush(new FlushRequest(index)).actionGet();
                }
            }
            finally {
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.bulk.BulkRequestBuilder.numberOfActions()

                    Logger.error(this, e.getMessage(), e);
                  }
                    }
            }
            HibernateUtil.closeSession();
                if(bulk.numberOfActions()>0) {
                    bulk.execute(new ActionListener<BulkResponse>() {
                        void deleteRecords() {
                            addRecordsToDelete(recordsToDelete);
                        }
                                public void onResponse(BulkResponse resp) {
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.action.bulk.BulkRequestBuilder.numberOfActions()

      BulkRequestBuilder bulk=new ESClient().getClient().prepareBulk();
      for(Contentlet cont : contentlets) {
          permissionCache.remove(cont.getPermissionId());
          indexAPI.addContentToIndex(cont, false, true, true, bulk);
      }
      if(bulk.numberOfActions()>0)
          bulk.execute().actionGet();

      offset=offset+limit;
    } while(contentlets.size()>0);
  }
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.numberOfActions()

        }

        // only submit the bulk request if there are index/delete actions
        // it is possible not to have any actions when parsing xml due to the
        // commit and optimize messages that will not generate documents
        if (bulkRequest.numberOfActions() > 0) {
            client.bulk(bulkRequest, new ActionListener<BulkResponse>() {

                // successful bulk request
                public void onResponse(BulkResponse response) {
                    logger.info("Bulk request completed");
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.numberOfActions()

    }

    // only submit the bulk request if there are index/delete actions
    // it is possible not to have any actions when parsing xml due to the
    // commit and optimize messages that will not generate documents
    if (bulkRequest.numberOfActions() > 0) {
      client.bulk(bulkRequest, new ActionListener<BulkResponse>() {

        // successful bulk request
        public void onResponse(BulkResponse response) {
          logger.info("Bulk request completed");
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.numberOfActions()

                while (req != null && (nb == 0 || nb < max)) {
                    bulk.add(req);
                    nb++;
                    req = queue.poll();
                }
                if (bulk.numberOfActions() > 0) {
                    BulkResponse rep = getNode().client().bulk(bulk).actionGet();
                    for (BulkItemResponse bir : rep.getItems()) {
                        if (bir.isFailed()) {
                            LOGGER.warn("Error executing request: {}", bir.getFailureMessage());
                        }
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.numberOfActions()

        doAnswer(new Answer() {
            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                final BulkRequest req = (BulkRequest) invocation.getArguments()[0];
                rateLimiter.acquire(req.numberOfActions());

                BulkItemResponse[] responses = new BulkItemResponse[req.numberOfActions()];
                for (int i = 0; i < responses.length; ++i) {
                    BulkItemResponse response = mock(BulkItemResponse.class);
                    doReturn(false).when(response).isFailed();
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.numberOfActions()

            @Override
            public Object answer(InvocationOnMock invocation) throws Throwable {
                final BulkRequest req = (BulkRequest) invocation.getArguments()[0];
                rateLimiter.acquire(req.numberOfActions());

                BulkItemResponse[] responses = new BulkItemResponse[req.numberOfActions()];
                for (int i = 0; i < responses.length; ++i) {
                    BulkItemResponse response = mock(BulkItemResponse.class);
                    doReturn(false).when(response).isFailed();
                    responses[i] = response;
                }
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequestBuilder.numberOfActions()

        }

        bulkRequest.add(request);
      }

      int size = bulkRequest.numberOfActions();
      if (size <= 0) {
        sinkCounter.incrementBatchEmptyCount();
        counterGroup.incrementAndGet("channel.underflow");
        status = Status.BACKOFF;
      } else {
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.