Examples of Traverser


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

            new DocPusherFactory(new MockFileFeedConnection(out));

        MockInstantiator instantiator =
            new MockInstantiator(new ThreadPool(300, new SystemClock()));

        Traverser traverser = new QueryTraverser(pusherFactory, qtm,
            instantiator.getTraversalStateStore(connectorName),
            connectorName, null, new SystemClock());

        instantiator.setupTraverser(connectorName, traverser);

        System.out.println();
        System.out.println("Running batch test batchsize " + batchHint);

        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 " +
View Full Code Here

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

    final Session session = this.connector.login();
    GlobalState.forgetState(null);
    final SharepointTraversalManager traversalManager = (SharepointTraversalManager) session.getTraversalManager();
    final MockInstantiator instantiator = new MockInstantiator(new ThreadPool(
        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.Traverser

      if (traversalManager == null) {
        return false;
      }
      currentBatchKey = new Object();
      BatchCoordinator batchCoordinator = new BatchCoordinator(this);
      Traverser traverser = new QueryTraverser(pusherFactory,
          traversalManager, batchCoordinator, name,
          Context.getInstance().getTraversalContext(), clock);
      TimedCancelable batch =  new CancelableBatch(traverser, name,
          batchCoordinator, batchCoordinator, batchSize);
      taskHandle = threadPool.submit(batch);
View Full Code Here

Examples of com.tinkerpop.gremlin.process.Traverser

    }

    private void assertBranchFactor(final double branchFactor,
                                    final Traversal t,
                                    final Iterator inputs) {
        Traverser start = new SimpleTraverser(null, null);
        MatchStep.TraversalWrapper w = new MatchStep.TraversalWrapper(t, "a", "b");
        MatchStep.TraversalUpdater updater = new MatchStep.TraversalUpdater<>(w, inputs, start, "x");
        while (updater.hasNext()) {
            updater.next();
        }
View Full Code Here

Examples of org.codehaus.janino.util.Traverser

       
        cu = new Parser(new Scanner("", new ByteArrayInputStream(javaSource.getBytes()))).parseCompilationUnit();
        final ArrayList clsNames = new ArrayList();

        // Traverse it and count declarations.
        new Traverser(){
      public void traverseClassDeclaration(ClassDeclaration arg0) {
        clsNames.add(arg0.getClassName());
        super.traverseClassDeclaration(arg0);
      }
        }.traverseCompilationUnit(cu);
View Full Code Here

Examples of org.codehaus.janino.util.Traverser

        /**
         * Sets enclosing block statement for this object and all subordinate
         * {@link org.codehaus.janino.Java.Rvalue} objects.
         */
        public final void setEnclosingBlockStatement(final Java.BlockStatement enclosingBlockStatement) {
            this.accept((Visitor.RvalueVisitor) new Traverser() {
                public void traverseRvalue(Java.Rvalue rv) {
                    if (rv.enclosingBlockStatement != null && enclosingBlockStatement != rv.enclosingBlockStatement) {
                        throw new JaninoRuntimeException(
                            "Enclosing block statement for rvalue \""
                            + rv
View Full Code Here

Examples of org.codehaus.janino.util.Traverser

                class UCE extends RuntimeException {
                    final CompileException ce;
                    UCE(CompileException ce) { this.ce = ce; }
                }
                try {
                    new Traverser() {

                        // "method(...)", "x.method(...)"
                        public void traverseMethodInvocation(Java.MethodInvocation mi) {
                            try {
                                this.match(mi, uc.findIMethod(mi));
View Full Code Here

Examples of org.codehaus.janino.util.Traverser

            throw new CompileException("Unexpected token \"" + scanner.peek() + "\"", scanner.location());
        }

        // Traverse the expression for ambiguous names and guess which of them are parameter names.
        final Set parameterNames = new HashSet();
        rvalue.accept((RvalueVisitor) new Traverser() {
            public void traverseAmbiguousName(AmbiguousName an) {

                // If any of the components starts with an upper-case letter, then the ambiguous
                // name is most probably a type name, e.g. "System.out" or "java.lang.System.out".
                for (int i = 0; i < an.identifiers.length; ++i) {
View Full Code Here

Examples of org.codehaus.janino.util.Traverser

        while (!scanner.peek().isEOF()) block.addStatement(parser.parseBlockStatement());

        // Traverse the block for ambiguous names and guess which of them are parameter names.
        final Set localVariableNames = new HashSet();
        final Set parameterNames = new HashSet();
        new Traverser() {
            public void traverseLocalVariableDeclarationStatement(LocalVariableDeclarationStatement lvds) {
                for (int i = 0; i < lvds.variableDeclarators.length; ++i) {
                    localVariableNames.add(lvds.variableDeclarators[i].name);
                }
                super.traverseLocalVariableDeclarationStatement(lvds);
View Full Code Here

Examples of org.neo4j.graphdb.Traverser

        final StopEvaluator stopEval = new PathStopEval();
        final PathReturnEval returnEval1 = new PathReturnEval( traversedNodes1,
            traversedNodes2 );
        final PathReturnEval returnEval2 = new PathReturnEval( traversedNodes2,
            traversedNodes1 );
        final Traverser trav1 = startNode.traverse( Order.BREADTH_FIRST,
            stopEval, returnEval1, relType, Direction.BOTH );
        final Traverser trav2 = endNode.traverse( Order.BREADTH_FIRST,
            stopEval, returnEval2, relType, Direction.BOTH );
        Iterator<Node> itr1 = trav1.iterator();
        Iterator<Node> itr2 = trav2.iterator();
        while ( itr1.hasNext() || itr2.hasNext() )
        {
            if ( itr1.hasNext() )
            {
                itr1.next();
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.