Examples of FindTreeChild


Examples of org.locationtech.geogig.api.plumbing.FindTreeChild

        StagingArea index = geogig.getRepository().index();

        FeatureBuilder featureBuilder = new FeatureBuilder(NODE_REV_TYPE);
        List<Coordinate> coordinates = Lists.newArrayList(nodes.size());
        FindTreeChild findTreeChild = geogig.command(FindTreeChild.class);
        findTreeChild.setIndex(true);
        ObjectId rootTreeId = geogig.command(ResolveTreeish.class).setTreeish(Ref.HEAD).call()
                .get();
        if (!rootTreeId.isNull()) {
            RevTree headTree = geogig.command(RevObjectParse.class).setObjectId(rootTreeId)
                    .call(RevTree.class).get();
            findTreeChild.setParent(headTree);
        }
        for (Long nodeId : nodes) {
            Coordinate coord = thisChangePointCache.get(nodeId);
            if (coord == null) {
                String fid = String.valueOf(nodeId);
                String path = NodeRef.appendChild(NODE_TYPE_NAME, fid);
                Optional<org.locationtech.geogig.api.Node> ref = index.findStaged(path);
                if (!ref.isPresent()) {
                    Optional<NodeRef> nodeRef = findTreeChild.setChildPath(path).call();
                    if (nodeRef.isPresent()) {
                        ref = Optional.of(nodeRef.get().getNode());
                    } else {
                        ref = Optional.absent();
                    }
View Full Code Here

Examples of org.locationtech.geogig.api.plumbing.FindTreeChild

        // CharSequence treeStr =
        // repo.command(CatObject.class).setObject(Suppliers.ofInstance(tree))
        // .call();
        // System.out.println(treeStr);

        final FindTreeChild childFinder = repo.command(FindTreeChild.class).setParent(tree);

        sw.reset().start();
        System.err.println("Reading " + numEntries + " entries....");
        for (int i = 0; i < numEntries; i++) {
            if ((i + 1) % (numEntries / 10) == 0) {
                System.err.print("#" + (i + 1));
            } else if ((i + 1) % (numEntries / 100) == 0) {
                System.err.print('.');
            }
            String key = "Feature." + i;
            // ObjectId oid = ObjectId.forString(key);
            Optional<NodeRef> ref = childFinder.setChildPath(key).call();
            assertTrue(key, ref.isPresent());
            // assertEquals(key, ref.get().getPath());
            // assertEquals(key, oid, ref.get().getObjectId());
        }
        sw.stop();
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.