Package com.google.enterprise.connector.spi

Examples of com.google.enterprise.connector.spi.TraversalManager.startTraversal()


    ArrayList<Document> documents = new ArrayList<Document>();
    TraversalManager tm = ConnectorFixture.getTraversalManager(
        connectorSession);
    // Get the first set of documents.
    tm.setBatchHint(20);
    DocumentList docList = tm.startTraversal();
    assertNotNull("startTraversal returned a null document list", docList);
    while (docList != null) {
      Document doc;
      while (null != (doc = docList.nextDocument())) {
        documents.add((NotesConnectorDocument) doc);
View Full Code Here


    assertNotNull(tm);
    assertTrue(tm instanceof NotesTraversalManager);

    // Get the first set of documents.
    tm.setBatchHint(5);
    DocumentList docList = tm.startTraversal();
    Document doc;
    String checkpoint = null;
    List<String> docIdList = new ArrayList<String>(10);
    assertNotNull("startTraversal returned a null document list", docList);
    while (null != (doc = docList.nextDocument())) {
View Full Code Here

    Set<String> docIdListFirstTraversal = new HashSet<String>(100);
    List<String> duplicatesFirstTraversal = new ArrayList<String>(100);
    // Get the first set of documents.
    tm.setBatchHint(20);
    DocumentList docList = tm.startTraversal();
    while (docList != null) {
      Document doc = null;
      while (null != (doc = docList.nextDocument())) {
        String docId = doc.findProperty(SpiConstants.PROPNAME_DOCID).
            nextValue().toString();
View Full Code Here

    Set<String> docIdListSecondTraversal = new HashSet<String>(100);
    List<String> duplicatesSecondTraversal = new ArrayList<String>(100);
    // Get the second set of documents.
    tm.setBatchHint(20);
    docList = tm.startTraversal();
    while (docList != null) {
      Document doc = null;
      while (null != (doc = docList.nextDocument())) {
        String docId = doc.findProperty(SpiConstants.PROPNAME_DOCID).
            nextValue().toString();
View Full Code Here

    TraversalManager tm = ConnectorFixture.getTraversalManager(
        (NotesConnectorSession) session);

    // Get the first set of documents.
    tm.setBatchHint(25);
    DocumentList docList = tm.startTraversal();
    assertNotNull("startTraversal returned a null document list", docList);
    Document doc;
    while (null != (doc = docList.nextDocument())) {
      String docId = doc.findProperty(SpiConstants.PROPNAME_DOCID).
          nextValue().toString();
View Full Code Here

    Session sess = conn.login();

    TraversalManager mgr = sess.getTraversalManager();

    HashSet<String> nodes = new HashSet<String>();
    LivelinkDocumentList docList = (LivelinkDocumentList) mgr.startTraversal();
    while (docList != null) {
      assertNoDuplicates(docList, nodes);
      String checkpoint = docList.checkpoint();
      docList = (LivelinkDocumentList) mgr.resumeTraversal(checkpoint);
    }
View Full Code Here

  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

    conn.setIncludedLocationNodes(getStartNodes());

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

    DocumentList rs = mgr.startTraversal();
    processResultSet(rs);
  }

  private String getStartNodes() throws RepositoryException {
    try {
View Full Code Here

    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

      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);
      }
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.