Package org.apache.jackrabbit.oak.plugins.mongomk.Node

Examples of org.apache.jackrabbit.oak.plugins.mongomk.Node.Children


        } else {
            // use long to avoid overflows
            long m = ((long) maxChildNodes) + offset;
            max = (int) Math.min(m, Integer.MAX_VALUE);
        }
        Children c = nodeStore.getChildren(path, rev, max);
        for (long i = offset; i < c.children.size(); i++) {
            if (maxChildNodes-- <= 0) {
                break;
            }
            String name = PathUtils.getName(c.children.get((int) i));
View Full Code Here


    }

    public Children getChildren(final String path, final Revision rev, final int limitthrows MicroKernelException {
        checkRevisionAge(rev, path);
        String key = path + "@" + rev;
        Children children;
        try {
            children = nodeChildrenCache.get(key, new Callable<Children>() {
                @Override
                public Children call() throws Exception {
                    return readChildren(path, rev, limit);
View Full Code Here

        // to do that, use the *name* of the last entry of the previous batch of children
        // as the starting point
        String from = Utils.getKeyLowerLimit(path);
        String to = Utils.getKeyUpperLimit(path);
        List<NodeDocument> list;
        Children c = new Children();
        int rawLimit = limit;
        do {
            c.children.clear();
            c.hasMore = true;
            list = store.query(Collection.NODES,
View Full Code Here

            }
        }
        // TODO this does not work well for large child node lists
        // use a MongoDB index instead
        int max = MANY_CHILDREN_THRESHOLD;
        Children fromChildren, toChildren;
        fromChildren = getChildren(path, fromRev, max);
        toChildren = getChildren(path, toRev, max);
        if (!fromChildren.hasMore && !toChildren.hasMore) {
            diffFewChildren(w, fromChildren, fromRev, toChildren, toRev);
        } else {
View Full Code Here

        if (offset > 0) {
            // TODO workaround for missing offset
            // support in getChildren
            max = Integer.MAX_VALUE;
        }
        Children c = getChildren(path, rev, max);
        for (long i = offset; i < c.children.size(); i++) {
            if (maxChildNodes-- <= 0) {
                break;
            }
            String name = PathUtils.getName(c.children.get((int) i));
View Full Code Here

        } else {
            // the document was updated:
            // we no longer need to update it in a background process
            unsaved.remove(path);
        }
        Children c = nodeChildrenCache.getIfPresent(path + "@" + rev);
        if (isNew || (!isDelete && c != null)) {
            String key = path + "@" + rev;
            Children c2 = new Children();
            TreeSet<String> set = new TreeSet<String>();
            if (c != null) {
                set.addAll(c.children);
            }
            set.removeAll(removed);
View Full Code Here

            }
        }
        // TODO this does not work well for large child node lists
        // use a MongoDB index instead
        int max = MANY_CHILDREN_THRESHOLD;
        Children fromChildren, toChildren;
        fromChildren = nodeStore.getChildren(path, fromRev, max);
        toChildren = nodeStore.getChildren(path, toRev, max);
        if (!fromChildren.hasMore && !toChildren.hasMore) {
            diffFewChildren(w, fromChildren, fromRev, toChildren, toRev);
        } else {
View Full Code Here

        } else {
            // use long to avoid overflows
            long m = ((long) maxChildNodes) + offset;
            max = (int) Math.min(m, Integer.MAX_VALUE);
        }
        Children c = nodeStore.getChildren(path, rev, max);
        for (long i = offset; i < c.children.size(); i++) {
            if (maxChildNodes-- <= 0) {
                break;
            }
            String name = PathUtils.getName(c.children.get((int) i));
View Full Code Here

    @Test
    public void nodeChildManyChildren() throws Exception {
        measureMemory(new Callable<Object[]>() {
            @Override
            public Object[] call() {
                Children n = generateNodeChild(100);
                return new Object[]{n, n.getMemory() + OVERHEAD};
            }
        });
    }
View Full Code Here

    @Test
    public void nodeChild() throws Exception {
        measureMemory(new Callable<Object[]>() {
            @Override
            public Object[] call() {
                Children n = generateNodeChild(5);
                return new Object[]{n, n.getMemory() + OVERHEAD};
            }
        });
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.mongomk.Node.Children

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.