Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.TraversalManager


  }

  public void testTraversal() throws RepositoryException {
    Session sess = conn.login();

    TraversalManager mgr = sess.getTraversalManager();
    mgr.setBatchHint(3000);

    String checkpoint = "2007-02-16 14:39:09,31257";

    DocumentList rs = mgr.resumeTraversal(checkpoint);
    processResultSet(rs);
  }
View Full Code Here


  public void testTraversal() throws RepositoryException {
    Session sess = conn.login();

    conn.setIncludedLocationNodes(getStartNodes());

    TraversalManager mgr = sess.getTraversalManager();
    mgr.setBatchHint(3000);

    DocumentList rs = mgr.startTraversal();
    processResultSet(rs);
  }
View Full Code Here

   * fetches all of the content, which slows it down considerably.
   */
  public void testPerformance(int dummy) throws Exception {
    // Traverse the repository for a bunch of ids.
    final int batchHint = 100000;
    TraversalManager tm = session.getTraversalManager();
    tm.setBatchHint(batchHint);
    DocumentList docList = tm.startTraversal();
    ArrayList<String> docids = new ArrayList<String>();
    Document doc;
    while ((doc = docList.nextDocument()) != null) {
      Property p = doc.findProperty(SpiConstants.PROPNAME_DOCID);
      docids.add(p.nextValue().toString());
View Full Code Here

    private void runTestBatches(int batchHint) throws IOException,
            RepositoryLoginException, RepositoryException,
            InterruptedException, ConnectorNotFoundException {
        Session sess = conn.login();
        TraversalManager qtm = sess.getTraversalManager();

        String connectorName = "livelink";

        OutputStream out =
            new FileOutputStream("traverser-test.log");
View Full Code Here

    Checkpoint checkpoint = new Checkpoint();
    checkpoint.setInsertCheckpoint(docInfo.toDate("ModifyDate"),
        objectId - 1);

    // Now push that one document
    TraversalManager mgr = sess.getTraversalManager();
    mgr.setBatchHint(1);
    DocumentList rs = mgr.resumeTraversal(checkpoint.toString() + ',');
    processResultSet(rs);
  }
View Full Code Here

    final AuthorizationManager authNMan = session.getAuthorizationManager();
    assertNotNull(authNMan);
  }

  public void testGetTraversalManager() throws Exception {
    final TraversalManager travMan = session.getTraversalManager();
    assertNotNull(travMan);
  }
View Full Code Here

        Checkpoint checkpoint = new Checkpoint();
        checkpoint.setInsertCheckpoint(docInfo.toDate("ModifyDate"),
                                       objectId - 1);

        // Now push that one document.
        TraversalManager mgr = sess.getTraversalManager();
        mgr.setBatchHint(1);
        DocumentList rs = mgr.resumeTraversal(checkpoint.toString() + ',');
        pushResultSet(rs);
    }
View Full Code Here

    try {
      Connector connector = new GdConnector();
      Session session = connector.login();
      AuthenticationManager authnManager = session.getAuthenticationManager();
      AuthorizationManager authzManager = session.getAuthorizationManager();
      TraversalManager traversalManager = session.getTraversalManager();
    } catch (ClassCastException cce) {
      Assert.fail(cce.toString());
    } catch (RepositoryException re) {
      // this is OK to throw
    }
View Full Code Here

  }

  public void testTraversal() throws RepositoryException {
    Session sess = conn.login();

    TraversalManager mgr = sess.getTraversalManager();
    mgr.setBatchHint(20);

    System.out.println("============ startTraversal ============");
    LivelinkDocumentList docList = (LivelinkDocumentList) mgr.startTraversal();
    while (docList != null) {
      processResultSet(docList);
      String checkpoint = docList.checkpoint();
      System.out.println("============ resumeTraversal ============");
      docList = (LivelinkDocumentList) mgr.resumeTraversal(checkpoint);
    }
  }
View Full Code Here

   * vary as the batch size changes.
   */
  public void testResumeTraversal() throws RepositoryException {
    Session sess = conn.login();

    TraversalManager mgr = sess.getTraversalManager();

    // If time comparisons aren't working, then a batch size of
    // one will produce one row for each unique timestamp, so a
    // size of 100, or even two, would necessarily include some of
    // those duplicates that were elided.
    // FIXME: A batch size of 1 was killing one of the Livelink
    // instances on swift with too many requests. Without it this
    // test is somewhat pointless, so we should figure out if we
    // can put in a delay, get a better Livelink instance, get a
    // better Solaris server, or something. I'm leaving the "1"
    // in place commented out, using // for convenience.
    int[] batchHints = { // 1,
      100 };
    int previousRowCount = 0;
    for (int i = 0; i < batchHints.length; i++) {
      long before = System.currentTimeMillis();
      mgr.setBatchHint(batchHints[i]);

      int rowCount = 0;
      LivelinkDocumentList docList =
          (LivelinkDocumentList) mgr.startTraversal();
      while (docList != null) {
        rowCount += countResultSet(docList);
        String checkpoint = docList.checkpoint();
        docList = (LivelinkDocumentList) mgr.resumeTraversal(checkpoint);
      }
      long after = System.currentTimeMillis();
      System.out.println("TIME: " + (after - before));
      if (previousRowCount != 0) {
        assertEquals("Difference at " + batchHints[i],
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.spi.TraversalManager

Copyright © 2018 www.massapicom. 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.