Package org.elasticsearch.action.bulk

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


    }

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

                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

        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

            @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

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.