Package org.locationtech.geogig.storage

Examples of org.locationtech.geogig.storage.ObjectDatabase


    }

    @Test
    @Ignore
    public void testBuild() {
        ObjectDatabase origin = new HeapObjectDatabse();
        origin.open();
        ObjectDatabase target = new HeapObjectDatabse();
        target.open();
        RevTree tree = root.build(origin, target);

        Iterator<NodeRef> treeRefs = new DepthTreeIterator("", ObjectId.NULL, tree, target,
                Strategy.RECURSIVE_TREES_ONLY);
        MutableTree createFromRefs = MutableTree.createFromRefs(root.getNode().getObjectId(),
View Full Code Here


        assertFalse(diffTree.setOldVersion(Ref.HEAD).setNewVersion(Ref.HEAD).call().hasNext());
    }

    @Test
    public void testTreePathFiltering() {
        ObjectDatabase db = geogit.getContext().objectDatabase();
        RevTree tree1 = tree(100, db);
        RevTree tree2 = tree(50, db);
        RevTree root = createRoot(db, tree1, tree2);

        List<String> pathFilters = ImmutableList.of("tree1");
View Full Code Here

        assertEquals(pathFilters.size(), diffs.size());
    }

    @Test
    public void testBoundsFiltering() {
        ObjectDatabase db = geogit.getContext().objectDatabase();
        RevTree tree1 = tree(1000, db);
        RevTree tree2 = tree(50, db);
        RevTree root = createRoot(db, tree1, tree2);

        CoordinateReferenceSystem crs = revtype.type().getCoordinateReferenceSystem();
View Full Code Here

        assertEquals(2, diffs.size());
    }

    @Test
    public void testBoundsFilteringReprojecting() throws Exception {
        ObjectDatabase db = geogit.getContext().objectDatabase();
        RevTree tree1 = tree(1000, db);
        RevTree tree2 = tree(50, db);
        RevTree root = createRoot(db, tree1, tree2);

        CoordinateReferenceSystem nativeCrs = revtype.type().getCoordinateReferenceSystem();
View Full Code Here

        assertEquals(2, diffs.size());
    }

    @Test
    public void testChangeTypeFilter() {
        ObjectDatabase db = geogit.getContext().objectDatabase();
        final RevTree tree1 = tree(1000, db);
        final RevTree tree2 = tree(50, db);
        final RevTree tree2Changed;
        {
            RevTreeBuilder builder = new RevTreeBuilder(db, tree2);
            // add 10 changed features, and delete 10 more
            for (int i = 0; i < 20; i++) {
                if (i % 2 == 0) {
                    builder.remove(String.valueOf(i));
                } else {
                    builder.put(feature(i, ObjectId.forString("changed" + i)));
                }
            }
            tree2Changed = builder.build();
            db.put(tree2Changed);
            assertEquals(tree2.size() - 10, tree2Changed.size());
        }
        final RevTree root1 = createRoot(db, tree1, tree2);
        final RevTree root2 = createRoot(db, tree1, tree2Changed);
View Full Code Here

    /**
     * Apply path, bounds, and changeType filtering all at once
     */
    @Test
    public void testMixedFilters() {
        ObjectDatabase db = geogit.getContext().objectDatabase();
        final RevTree tree1 = tree(1000, db);
        final RevTree tree2 = tree(50, db);
        final RevTree tree2Changed;
        {
            RevTreeBuilder builder = new RevTreeBuilder(db, tree2);
            // add 10 changed features, and delete 10 more
            for (int i = 0; i < 20; i++) {
                if (i % 2 == 0) {
                    builder.remove(String.valueOf(i));
                } else {
                    builder.put(feature(i, ObjectId.forString("changed" + i)));
                }
            }
            tree2Changed = builder.build();
            db.put(tree2Changed);
            assertEquals(tree2.size() - 10, tree2Changed.size());
        }
        final RevTree root1 = createRoot(db, tree1, tree2);
        final RevTree root2 = createRoot(db, tree1, tree2Changed);
        final ObjectId rootId1 = root1.getId();
View Full Code Here

        System.err.printf("\t%s '%s' -> %s (%s)\n", ref.getType().toString().charAt(0), ref.path(),
                ref.objectId(), ref.getNode().getMetadataId());
    }

    private void verifyRepositoryTree(String path, ObjectId repoTreeId) {
        ObjectDatabase objectDb = this.objectDb;

        verifyTree(objectDb, path, repoTreeId);
    }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.storage.ObjectDatabase

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.