Package org.apache.jackrabbit.oak.spi.state

Examples of org.apache.jackrabbit.oak.spi.state.NodeStoreBranch.merge()


    private void modifyContent() throws Exception {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getHead().builder();
        builder.child("a").setProperty("foo", "bar");
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE);
    }

    private void readTree(NodeState root) {
        for (ChildNodeEntry cne : root.getChildNodeEntries()) {
            readTree(cne.getNodeState());
View Full Code Here


                .setProperty("bar", "def");
        builder.child("testSecond").setProperty("bar", "ghi");

        // merge it back in
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE);

        AsyncIndexUpdate async = new AsyncIndexUpdate(store, executor, provider);
        runIndexing(async, 1);
        root = store.getRoot();
View Full Code Here

        builder.child("newchild").child("other").child("testChild")
                .setProperty("foo", "xyz");

        // merge it back in
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE);

        AsyncIndexUpdate async = new AsyncIndexUpdate(store, executor, provider);
        runIndexing(async, 1);
        root = store.getRoot();
View Full Code Here

        addFolder(root, "folder-1");
        addFolder(root, "folder-2");
        addFile(root, "file-1");

        branch.setRoot(root.getNodeState());
        branch.merge(new EditorHook(new IndexUpdateProvider(
                new PropertyIndexEditorProvider())));

        NodeState rootState = store.getRoot();
        NodeTypeIndex index = new NodeTypeIndex();
        FilterImpl filter;
View Full Code Here

        builder.child("x");
        builder.child("y");
        builder.child("z");
        branch.setRoot(builder.getNodeState());

        state = branch.merge(EmptyHook.INSTANCE);
    }

    @After
    public void tearDown() {
        state = null;
View Full Code Here

        for (int i = 0; i <= N; i++) {
            builder.child("x" + i);
        }
        branch.setRoot(builder.getNodeState());

        state = branch.merge(EmptyHook.INSTANCE);
    }

    @After
    public void tearDown() {
        state = null;
View Full Code Here

        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        NodeStoreBranch branch = root.branch();
        branch.setRoot(newState);
        branch.merge(EmptyHook.INSTANCE);

        assertEquals(newState, root.getRoot());
        assertEquals(oldState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        builder.setProperty("foo", "bar");
        NodeState newState = builder.getNodeState();

        NodeStoreBranch branch = left.branch();
        branch.setRoot(newState);
        branch.merge(EmptyHook.INSTANCE);

        assertEquals(oldState, root.getRoot());
        assertEquals(newState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        leftBuilder.setProperty("foo", "bar");
        NodeState leftState = leftBuilder.getNodeState();

        NodeStoreBranch leftBranch = left.branch();
        leftBranch.setRoot(leftState);
        leftBranch.merge(EmptyHook.INSTANCE);

        assertEquals(oldState, root.getRoot());
        assertEquals(leftState, left.getRoot());
        assertEquals(oldState, right.getRoot());
View Full Code Here

        rightBuilder.setProperty("bar", "foo");
        NodeState rightState = rightBuilder.getNodeState();

        NodeStoreBranch rightBranch = right.branch();
        rightBranch.setRoot(rightState);
        rightBranch.merge(EmptyHook.INSTANCE);

        store.getJournal("right").merge();
        NodeState newState = root.getRoot();
        assertEquals("bar", newState.getProperty("foo").getValue(Type.STRING));
        assertEquals("foo", newState.getProperty("bar").getValue(Type.STRING));
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.