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

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.compareAgainstBaseState()


                    jsop.tag('*');
                }
                jsop.key(kpath).value(path);

                if (state != kstate) {
                    state.compareAgainstBaseState(
                            kstate, new JsopDiff(kernel, jsop, path));
                }
            }

            for (String path : deleted) {
View Full Code Here


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

        IndexHook l = new LuceneIndexDiff(builder);
        after.compareAgainstBaseState(before, l);
        l.apply();
        l.close();

        IndexDefinition testDef = new IndexDefinitionImpl("lucene",
                TYPE_LUCENE, "/oak:index/lucene");
View Full Code Here

        builder.child("a").child("b").child("c").setProperty("foo", "bar");

        NodeState after = builder.getNodeState();

        IndexHook l = new LuceneIndexDiff(builder);
        after.compareAgainstBaseState(before, l);
        l.apply();
        l.close();

        IndexDefinition testDef = new IndexDefinitionImpl("lucene",
                TYPE_LUCENE, "/oak:index/lucene");
View Full Code Here

        public void childNodeDeleted(String name, NodeState before) {
            if (NodeStateUtils.isHidden(name)) {
                return;
            }
            NodeState after = MemoryNodeState.EMPTY_NODE;
            after.compareAgainstBaseState(before,
                    new VersionDiff(this, vMgr, after.builder()));
        }

        /**
         * Returns <code>true</code> if the node of this VersionDiff
View Full Code Here

        assertEquals(MANY, lookup.find("foo", "xyz").size());
        withoutIndex = System.nanoTime() - withoutIndex;

        // ... then see how adding an index affects the code
        IndexHook p = new PropertyIndexDiff(builder);
        after.compareAgainstBaseState(before, p);
        p.apply();
        p.close();

        lookup = new PropertyIndexLookup(builder.getNodeState());
        long withIndex = System.nanoTime();
View Full Code Here

        assertEquals(ImmutableSet.of(), lookup.find("pqr", "foo"));
        withoutIndex = System.nanoTime() - withoutIndex;

        // ... then see how adding an index affects the code
        IndexHook p = new PropertyIndexDiff(builder);
        after.compareAgainstBaseState(before, p);
        p.apply();
        p.close();

        lookup = new PropertyIndexLookup(builder.getNodeState());
        long withIndex = System.nanoTime();
View Full Code Here

        // <type, <path, indexhook>>
        Map<String, Map<String, List<IndexHook>>> updates = new HashMap<String, Map<String, List<IndexHook>>>();
        NodeStateDiff diff = new IndexHookManagerDiff(provider, builder,
                updates);
        after.compareAgainstBaseState(before, diff);

        for (String type : updates.keySet()) {
            for (List<IndexHook> hooks : updates.get(type).values()) {
                for (IndexHook hook : hooks) {
                    hook.apply();
View Full Code Here

        }
        NodeState after = builder.getNodeState();

        // Add an index
        IndexHook p = new Property2IndexDiff(builder);
        after.compareAgainstBaseState(before, p);
        p.apply();
        p.close();

        // Query the index
        Property2IndexLookup lookup = new Property2IndexLookup(builder.getNodeState());
View Full Code Here

        }
        NodeState after = builder.getNodeState();

        // Add an index
        IndexHook p = new Property2IndexDiff(builder);
        after.compareAgainstBaseState(before, p);
        p.apply();
        p.close();

        // Query the index
        Property2IndexLookup lookup = new Property2IndexLookup(builder.getNodeState());
View Full Code Here

        NodeState base = ns3.retrieve(base3); // branch base
        assertNotNull(base);
        NodeState branchHead = ns3.retrieve(b3);
        assertNotNull(branchHead);
        TrackingDiff diff = new TrackingDiff();
        branchHead.compareAgainstBaseState(base, diff);
        assertEquals(1, diff.added.size());
        assertEquals(Sets.newHashSet("/mk3"), diff.added);
        assertEquals(new HashSet<String>(), diff.deleted);

        mk1.dispose();
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.