Examples of BatchResult


Examples of com.google.enterprise.connector.traversal.BatchResult

        int docsProcessed = 0;
        int totalDocsProcessed = 0;
        int batchNumber = 0;
        BatchSize batchSize = new BatchSize(batchHint);
        do {
            BatchResult result = traverser.runBatch(batchSize);
            docsProcessed = result.getCountProcessed();
            if (docsProcessed > 0) {
                totalDocsProcessed += docsProcessed;
            }
            System.out.println("Batch# " + batchNumber + " docs " +
                docsProcessed + " checkpoint " +
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

        5, new SystemClock()));
    final Traverser traverser = new QueryTraverser(new MockPusher(System.out),
        traversalManager, instantiator.getTraversalStateStore(connectorName),
        connectorName, Context.getInstance().getTraversalContext(),
        new SystemClock());
    BatchResult result = traverser.runBatch(new BatchSize(10));
    int totalDocsProcessed = result.getCountProcessed();
    assertTrue(totalDocsProcessed > 0);
  }
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

    return newBatchResult(numDocs, 250);
  }

  private BatchResult newBatchResult(int numDocs, int duration) {
    long now = clock.getTimeMillis();
    return new BatchResult(TraversalDelayPolicy.IMMEDIATE, numDocs,
        now - duration, now);
  }
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

                 tracker.getTraversalManagerCount());
    assertEquals(tracker.toString(), expectStartTraversalCount, tracker
        .getStartTraversalCount());
    assertEquals(tracker.toString(), expectResumeTraversalCount, tracker
        .getResumeTraversalCount());
    BatchResult batchResult = recordingLoadManager.getBatchResult(timeout);
    assertNotNull(batchResult);
    assertEquals(tracker.toString(), 1, batchResult.getCountProcessed());
    assertEquals(tracker.toString(), TraversalDelayPolicy.IMMEDIATE,
        batchResult.getDelayPolicy());
  }
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

  public void run() {
    NDC.push("Traverse " + traverserName);
    try {
      LOGGER.fine("Begin runBatch; traverserName = " + traverserName
          + "  " + batchSize);
      BatchResult batchResult = traverser.runBatch(batchSize);
      LOGGER.fine("Traverser " + traverserName + " batchDone with result = "
          + batchResult);
      batchResultRecorder.recordResult(batchResult);
    } finally {
      NDC.remove();
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

  }

  private void runBatch(final int expectCount, final int batchHint,
      final TraversalDelayPolicy expectDelayPolicy) throws Exception {
    BatchSize batchSize = new BatchSize(batchHint);
    BatchResult expectResult = new BatchResult(expectDelayPolicy, expectCount);
    MockTraverser traverser = new MockTraverser(batchSize, expectResult);
    MockBatchResultRecorder recorder = new MockBatchResultRecorder();
    MockBatchTimeout batchTimeout = new MockBatchTimeout();
    CancelableBatch batch =
        new CancelableBatch(traverser, "connector1", recorder, batchTimeout,
            batchSize);
    batch.run();
    BatchResult batchResult = recorder.getBatchResult();
    assertEquals(expectResult, batchResult);
    // TODO(strellis): Validate retryDelayMillis or remove it from
    // BatchRecorder.
    // TODO(bjohnson): Create tests where batchHint != batchMaximum, esp.
    // where returned batch has batchMaximum and greater than batchMaximum.
View Full Code Here

Examples of com.google.enterprise.connector.traversal.BatchResult

    minBatchSize = Math.min(load, batchSize);
    LOGGER.fine("Setting the minimum batch size to " + batchSize);

    rate = ((float) load) / periodInMillis;
    lastBatchSize = Math.min(load, batchSize);
    lastBatchResult = new BatchResult(TraversalDelayPolicy.IMMEDIATE,
                                      lastBatchSize, 0L, periodInMillis);
  }
View Full Code Here

Examples of com.gwtplatform.dispatch.rpc.shared.BatchResult

                }
            }
            results.add(result);
        }

        return new BatchResult(results);
    }
View Full Code Here

Examples of com.gwtplatform.dispatch.shared.BatchResult

                }
            }
            results.add(result);
        }

        return new BatchResult(results);
    }
View Full Code Here

Examples of com.ibatis.sqlmap.engine.execution.BatchResult

    sms.close();
    when(sms.getCurrentConnection()).thenReturn(null);
    sms.setUserConnection(null);
    sms.startBatch();
    when(sms.update("updateFoo", new Foo("bar"))).thenReturn(-2);
    List<BatchResult> results = Collections.singletonList(new BatchResult("updateFoo", "update foo"));
    results.get(0).setUpdateCounts(new int[] {1});
    when(sms.executeBatchDetailed()).thenReturn(results);
    writer.write(Collections.singletonList(new Foo("bar")));
  }
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.