Package org.apache.jackrabbit.commons.flat

Examples of org.apache.jackrabbit.commons.flat.BTreeManager


    static PropertySequence getPropertySequence(Node nMembers, UserManagerImpl userManager) throws RepositoryException {
        Comparator<String> order = Rank.comparableComparator();
        int maxChildren = userManager.getGroupMembershipSplitSize();
        int minChildren = maxChildren / 2;

        TreeManager treeManager = new BTreeManager(nMembers, minChildren, maxChildren, order,
                userManager.isAutoSave());

        return ItemSequence.createPropertySequence(treeManager);
    }
View Full Code Here


    static PropertySequence getPropertySequence(Node nMembers, UserManagerImpl userManager) throws RepositoryException {
        Comparator<String> order = Rank.comparableComparator();
        int maxChildren = userManager.getGroupMembershipSplitSize();
        int minChildren = maxChildren / 2;

        TreeManager treeManager = new BTreeManager(nMembers, minChildren, maxChildren, order,
                userManager.isAutoSave());

        return ItemSequence.createPropertySequence(treeManager);
    }
View Full Code Here

    }

    private PropertySequence getPropertySequence(Node nMembers) throws RepositoryException {
        Comparator<String> order = Rank.comparableComparator();
        int minChildren = memberSplitSize / 2;
        TreeManager treeManager = new BTreeManager(nMembers, minChildren, memberSplitSize, order, false);
        return ItemSequence.createPropertySequence(treeManager);
    }
View Full Code Here

    }

    private PropertySequence getPropertySequence(Node nMembers) throws RepositoryException {
        Comparator<String> order = Rank.comparableComparator();
        int minChildren = memberSplitSize / 2;
        TreeManager treeManager = new BTreeManager(nMembers, minChildren, memberSplitSize, order, false);
        return ItemSequence.createPropertySequence(treeManager);
    }
View Full Code Here

        superuser.save();
    }

    public void testEmptyNodeSequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        Iterator<Node> nodeIt = nodes.iterator();
        assertTrue(nodeIt.hasNext());
        assertTrue(treeManager.isRoot(nodeIt.next()));
        assertFalse(nodeIt.hasNext());

        checkTreeProperty(testNode, 5, 10, order);
        checkOrder(nodes, order);
        assertEmpty(nodes);
View Full Code Here

        assertEmpty(nodes);
    }

    public void testSingletonNodeSequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        nodes.addNode("key", NodeType.NT_UNSTRUCTURED);
        assertTrue(nodes.hasItem("key"));
View Full Code Here

        assertEmpty(nodes);
    }

    public void testNodeSequence() throws RepositoryException, IOException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
        NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);

        List<String> words = loadWords();
        Collections.shuffle(words);
View Full Code Here

        assertEmpty(nodes);
    }

    public void testEmptyPropertySequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 2, 4, order, true);
        PropertySequence properties = ItemSequence.createPropertySequence(treeManager, errorHandler);

        Iterator<Property> propertyIt = properties.iterator();
        assertFalse(propertyIt.hasNext());
        assertEmpty(properties);
View Full Code Here

        assertEmpty(properties);
    }

    public void testSingletonPropertySequence() throws RepositoryException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 2, 4, order, true);
        PropertySequence properties = ItemSequence.createPropertySequence(treeManager, errorHandler);

        ValueFactory vFactory = testNode.getSession().getValueFactory();
        properties.addProperty("key", vFactory.createValue("key_"));
        assertTrue(properties.hasItem("key"));
View Full Code Here

        assertEmpty(properties);
    }

    public void testPropertySequence() throws RepositoryException, IOException {
        Comparator<String> order = Rank.<String>comparableComparator();
        TreeManager treeManager = new BTreeManager(testNode, 2, 4, order, true);
        PropertySequence properties = ItemSequence.createPropertySequence(treeManager, errorHandler);

        List<String> words = loadWords();
        Collections.shuffle(words);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.commons.flat.BTreeManager

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.