public void scheduleOperations() {
   if (SolrMeterConfiguration.getProperty("headless.performUpdateOperations", "")
       .equalsIgnoreCase("true")) {
     if (getNumUpdates() > 0) {
       scheduleUpdateOperations();
     } else {
       completed = true;
     }
   } else {
     completed = true;
   }
 }
 private void scheduleUpdateOperations() {
   String updateDelay =
       SolrMeterConfiguration.getProperty(
           "headless.updateInitialDelay", String.valueOf(DEFAULT_INITIAL_DELAY_MS));
   new ScheduledThreadPoolExecutor(1)
       .schedule(
           new Runnable() {
             @Override
             public void run() {
               controller.onStart();
             }
           },
           Long.valueOf(updateDelay),
           TimeUnit.MILLISECONDS);
 }
  public void refreshView() {
    ArrayList<String> lines = new ArrayList<String>();
    lines.add(
        "added documents:\t" + String.valueOf(commitHistoryStatistic.getTotalAddedDocuments()));
    lines.add("errors on update:\t" + String.valueOf(commitHistoryStatistic.getUpdateErrorCount()));
    lines.add(
        "intended updates per minute:\t"
            + SolrMeterConfiguration.getProperty("solr.load.updatesperminute"));
    lines.add("update rate:\t" + String.valueOf(operationRateStatistic.getUpdateRate()));
    HeadlessUtils.outputData(
        "updateConsolePanel.title", HeadlessConsoleFrame.getOutputDirectory(), lines);

    if (commitHistoryStatistic.getTotalAddedDocuments() >= getNumUpdates()) {
      controller.onStop();
    }
  }
Пример #4
0
 private PingOperation createPingOperation() {
   return new PingOperation(
       SolrServerRegistry.getSolrServer(
           SolrMeterConfiguration.getProperty(SolrMeterConfiguration.SOLR_ADD_URL)));
 }
 private long getNumUpdates() {
   return Integer.valueOf(
       SolrMeterConfiguration.getProperty(
           "headless.numUpdates", String.valueOf(DEFAULT_NUM_UPDATES)));
 }
Пример #6
0
 protected QueryResponse executeQuery(SolrQuery query) throws SolrServerException {
   String requestMethod =
       SolrMeterConfiguration.getProperty(SolrMeterConfiguration.QUERY_METHOD, "GET");
   return executor.getSolrServer().query(query, METHOD.valueOf(requestMethod));
 }