Search in sources :

Example 1 with DiffCountConsumer

use of org.locationtech.geogig.api.plumbing.diff.DiffCountConsumer in project GeoGig by boundlessgeo.

the class DiffCount method _call.

@Override
protected DiffObjectCount _call() {
    checkState(oldRefSpec != null, "old ref spec not provided");
    checkState(newRefSpec != null, "new ref spec not provided");
    final RevTree oldTree = getTree(oldRefSpec);
    final RevTree newTree = getTree(newRefSpec);
    DiffObjectCount diffCount;
    StagingDatabase index = stagingDatabase();
    PreOrderDiffWalk visitor = new PreOrderDiffWalk(oldTree, newTree, index, index);
    DiffCountConsumer counter = new DiffCountConsumer(index);
    PreOrderDiffWalk.Consumer filter = counter;
    if (!pathFilters.isEmpty()) {
        filter = new PathFilteringDiffConsumer(pathFilters, counter);
    }
    visitor.walk(filter);
    diffCount = counter.get();
    return diffCount;
}
Also used : DiffObjectCount(org.locationtech.geogig.api.plumbing.diff.DiffObjectCount) PreOrderDiffWalk(org.locationtech.geogig.api.plumbing.diff.PreOrderDiffWalk) DiffCountConsumer(org.locationtech.geogig.api.plumbing.diff.DiffCountConsumer) RevTree(org.locationtech.geogig.api.RevTree) StagingDatabase(org.locationtech.geogig.storage.StagingDatabase) PathFilteringDiffConsumer(org.locationtech.geogig.api.plumbing.diff.PathFilteringDiffConsumer)

Aggregations

RevTree (org.locationtech.geogig.api.RevTree)1 DiffCountConsumer (org.locationtech.geogig.api.plumbing.diff.DiffCountConsumer)1 DiffObjectCount (org.locationtech.geogig.api.plumbing.diff.DiffObjectCount)1 PathFilteringDiffConsumer (org.locationtech.geogig.api.plumbing.diff.PathFilteringDiffConsumer)1 PreOrderDiffWalk (org.locationtech.geogig.api.plumbing.diff.PreOrderDiffWalk)1 StagingDatabase (org.locationtech.geogig.storage.StagingDatabase)1