Package org.locationtech.geogig.storage.GraphDatabase

Examples of org.locationtech.geogig.storage.GraphDatabase.GraphNode


    @Override
    protected Boolean _call() {
        Preconditions.checkState(start != null, "start commit has not been set.");
        Preconditions.checkState(end != null, "end commit has not been set.");

        GraphNode node = graphDb.getNode(start);
        return isSparsePath(node, end, false);
    }
View Full Code Here


        if (outgoing.hasNext()) {
            boolean node_sparse = node.isSparse();
            boolean combined_sparse = false;
            while (outgoing.hasNext()) {
                GraphEdge parent = outgoing.next();
                GraphNode parentNode = parent.getToNode();
                combined_sparse = combined_sparse
                        || isSparsePath(parentNode, end, sparse || node_sparse);
            }
            return combined_sparse;
        }
View Full Code Here

        Queue<GraphNode> leftQueue = new LinkedList<GraphNode>();
        Queue<GraphNode> rightQueue = new LinkedList<GraphNode>();

        GraphDatabase graphDb = graphDatabase();
        GraphNode leftNode = graphDb.getNode(leftId);
        leftQueue.add(leftNode);

        GraphNode rightNode = graphDb.getNode(rightId);
        rightQueue.add(rightNode);

        List<GraphNode> potentialCommonAncestors = new LinkedList<GraphNode>();
        while (!leftQueue.isEmpty() || !rightQueue.isEmpty()) {
            if (!leftQueue.isEmpty()) {
                GraphNode commit = leftQueue.poll();
                if (processCommit(commit, leftQueue, leftSet, rightQueue, rightSet)) {
                    potentialCommonAncestors.add(commit);
                }
            }
            if (!rightQueue.isEmpty()) {
                GraphNode commit = rightQueue.poll();
                if (processCommit(commit, rightQueue, rightSet, leftQueue, leftSet)) {
                    potentialCommonAncestors.add(commit);
                }
            }
        }
View Full Code Here

                return true;
            }
            Iterator<GraphEdge> edges = commit.getEdges(Direction.OUT);
            while (edges.hasNext()) {
                GraphEdge parentEdge = edges.next();
                GraphNode parent = parentEdge.getToNode();
                myQueue.add(parent);
            }
        }
        return false;
View Full Code Here

            Set<GraphNode> theirSet) {
        Queue<GraphNode> ancestorQueue = new LinkedList<GraphNode>();
        ancestorQueue.add(commit);
        Set<GraphNode> processed = new HashSet<GraphNode>();
        while (!ancestorQueue.isEmpty()) {
            GraphNode ancestor = ancestorQueue.poll();
            Iterator<GraphEdge> edges = ancestor.getEdges(Direction.OUT);
            while (edges.hasNext()) {
                GraphEdge relationship = edges.next();
                GraphNode parentNode = relationship.getToNode();
                if (theirSet.contains(parentNode)) {
                    if (!processed.contains(parentNode)) {
                        ancestorQueue.add(parentNode);
                        processed.add(parentNode);
                    }
View Full Code Here

            if (falseAncestors.contains(v)) {
                continue;
            }
            ancestorQueue.add(v);
            while (!ancestorQueue.isEmpty()) {
                GraphNode ancestor = ancestorQueue.poll();
                Iterator<GraphEdge> edges = ancestor.getEdges(Direction.OUT);
                while (edges.hasNext()) {
                    GraphEdge parent = edges.next();
                    GraphNode parentNode = parent.getToNode();
                    if (parentNode.getIdentifier() != ancestor.getIdentifier()) {
                        if (leftSet.contains(parentNode) || rightSet.contains(parentNode)) {
                            if (!processed.contains(parentNode)) {
                                ancestorQueue.add(parentNode);
                                processed.add(parentNode);
                            }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.storage.GraphDatabase.GraphNode

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.