Examples of numberOfActions()


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

            }

            request.setConsistencyLevel(WriteConsistencyLevel.ONE);
            request.setReplicationType(ReplicationType.ASYNC);

            if (request.numberOfActions() > 0) {
                BulkResponse response = c.bulk(request.request()).actionGet();

                LOG.info("Moving index <{}> to <{}>: Bulk indexed {} messages, took {} ms, failures: {}",
                        source, target, response.getItems().length, response.getTookInMillis(), response.hasFailures());
View Full Code Here

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

            brb.add(getClient().prepareIndex(appid, obj.getType(), obj.getId()).
                setSource(Utils.getAnnotatedFields(obj)));
            pager.setLastKey(obj.getId());
          }
          // bulk index 1000 objects
          if (brb.numberOfActions() > 100) {
            resp = brb.execute().actionGet();
            logger.info("rebuildIndex(): indexed {}, hasFailures: {}",
                brb.numberOfActions(), resp.hasFailures());
          }
        } while(!(list = dao.readPage(appid, pager)).isEmpty());
View Full Code Here

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

          }
          // bulk index 1000 objects
          if (brb.numberOfActions() > 100) {
            resp = brb.execute().actionGet();
            logger.info("rebuildIndex(): indexed {}, hasFailures: {}",
                brb.numberOfActions(), resp.hasFailures());
          }
        } while(!(list = dao.readPage(appid, pager)).isEmpty());
      }

      // anything left after loop? index that too
View Full Code Here

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

          }
        } while(!(list = dao.readPage(appid, pager)).isEmpty());
      }

      // anything left after loop? index that too
      if (brb.numberOfActions() > 0) {
        resp = brb.execute().actionGet();
        logger.info("rebuildIndex(): indexed {}, hasFailures: {}",
            brb.numberOfActions(), resp.hasFailures());
      }
View Full Code Here

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

      // anything left after loop? index that too
      if (brb.numberOfActions() > 0) {
        resp = brb.execute().actionGet();
        logger.info("rebuildIndex(): indexed {}, hasFailures: {}",
            brb.numberOfActions(), resp.hasFailures());
      }

      // switch to alias NEW_INDEX -> ALIAS, OLD_INDEX -> X, deleting the old index
      switchIndexToAlias(oldName, newName, appid, true);
    } catch (Exception e) {
View Full Code Here

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

                        }
                    }
                })
                .toList();

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

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

                    }
                })
                .toList();

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

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

        }

        bulkRequest.add(indexRequest);
      }

      int size = bulkRequest.numberOfActions();
      if (size <= 0) {
        sinkCounter.incrementBatchEmptyCount();
        counterGroup.incrementAndGet("channel.underflow");
        status = Status.BACKOFF;
      } else {
View Full Code Here

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

                }
            }

            uow.discard();

            if( bulkBuilder.numberOfActions() > 0 )
            {

                // Execute bulk actions
                BulkResponse bulkResponse = bulkBuilder.execute().actionGet();
View Full Code Here

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

            );
        }

        // Perform bulk request
        OperationBatch completeListener = null;
        if (bulkRequestBuilder.numberOfActions() > 0) {
            synchronized(this) {
                completeListener = new OperationBatch(0, toIndex, toDelete);
                operationBatchList.add(completeListener);
                try {
                    bulkRequestBuilder.execute().addListener(completeListener);
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.