Examples of numberOfActions()


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
      getClient().admin().indices().prepareAliases().
          addAlias(newName, appid).
View Full Code Here

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

  @Test
  public void executeBulkRequest() {
    // Setup
    BulkRequestBuilder bulkRequestBuilderMocked = mock(BulkRequestBuilder.class);
    when(bulkRequestBuilderMocked.numberOfActions()).thenReturn(1);

    ListenableActionFuture<BulkResponse> listenableActionFutureMocked = mock(ListenableActionFuture.class);
    when(bulkRequestBuilderMocked.execute()).thenReturn(listenableActionFutureMocked);
    BulkResponse bulkResponseMocked = mock(BulkResponse.class);
    when(listenableActionFutureMocked.actionGet()).thenReturn(bulkResponseMocked);
View Full Code Here

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

  @Test
  public void executeBulkRequest_withFailure() {
    // Setup
    BulkRequestBuilder bulkRequestBuilderMocked = mock(BulkRequestBuilder.class);
    when(bulkRequestBuilderMocked.numberOfActions()).thenReturn(1);

    ListenableActionFuture<BulkResponse> listenableActionFutureMocked = mock(ListenableActionFuture.class);
    when(bulkRequestBuilderMocked.execute()).thenReturn(listenableActionFutureMocked);
    BulkResponse bulkResponseMocked = mock(BulkResponse.class);
    when(listenableActionFutureMocked.actionGet()).thenReturn(bulkResponseMocked);
View Full Code Here

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

  @Test
  public void executeBulkRequest_withNoResult() {
    // Setup
    BulkRequestBuilder bulkRequestBuilderMocked = mock(BulkRequestBuilder.class);
    when(bulkRequestBuilderMocked.numberOfActions()).thenReturn(0);

    // Action
    entityDao.executeBulkRequest(bulkRequestBuilderMocked);

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