Package org.apache.jackrabbit.oak.plugins.document.memory

Examples of org.apache.jackrabbit.oak.plugins.document.memory.MemoryDocumentStore.find()


        s.release();
        writer.join();
        assertEquals("expected exception", 1, exceptions.size());

        String id = Utils.getIdFromPath("/foo/node");
        NodeDocument doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());
        id = Utils.getIdFromPath("/bar/node");
        doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
View Full Code Here


        String id = Utils.getIdFromPath("/foo/node");
        NodeDocument doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());
        id = Utils.getIdFromPath("/bar/node");
        doc = docStore.find(Collection.NODES, id);
        assertNotNull("document with id " + id + " does not exist", doc);
        assertTrue(!doc.getLastRev().isEmpty());

        mk.dispose();
    }
View Full Code Here

                .setAsyncDelay(0).clock(clock).getNodeStore();
        DocumentNodeStore nodeStore3 = new DocumentMK.Builder()
                .setDocumentStore(docStore).setClusterId(3)
                .setAsyncDelay(0).clock(clock).getNodeStore();

        NodeDocument doc = docStore.find(NODES, Utils.getIdFromPath("/"));
        assertNotNull(doc);
        Revision created = doc.getLocalDeleted().firstKey();
        assertEquals(1, created.getClusterId());

        clock.waitUntil(System.currentTimeMillis() +
View Full Code Here

        clock.waitUntil(System.currentTimeMillis() +
                DocumentNodeStore.REMEMBER_REVISION_ORDER_MILLIS + 1000);
        nodeStore3.runBackgroundOperations();

        doc = docStore.find(NODES, Utils.getIdFromPath("/"));
        assertNotNull(doc);
        NodeState state = doc.getNodeAtRevision(nodeStore3,
                nodeStore3.getHeadRevision(), null);
        assertNotNull(state);
View Full Code Here

        ns1.merge(builder1, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        ns1.runBackgroundOperations();

        // get current _modified timestamp on /node
        NodeDocument doc = docStore.find(NODES, Utils.getIdFromPath("/node"));
        Long mod1 = (Long) doc.get(MODIFIED_IN_SECS);
        assertNotNull(mod1);

        ns2.runBackgroundOperations();
View Full Code Here

        Long mod1 = (Long) doc.get(MODIFIED_IN_SECS);
        assertNotNull(mod1);

        ns2.runBackgroundOperations();

        doc = docStore.find(NODES, Utils.getIdFromPath("/node"));
        Long mod2 = (Long) doc.get(MODIFIED_IN_SECS);
        assertTrue("" + mod2 + " < " + mod1, mod2 >= mod1);

        ns1.dispose();
        ns2.dispose();
View Full Code Here

        NodeDocument.setRevision(op, r2, "c");
        NodeDocument.setPrevious(op, new Range(r0, r0, 0));
        NodeDocument.setPrevious(op, new Range(r1high, r1low, 0));
        store.createOrUpdate(NODES, op);

        NodeDocument doc = store.find(NODES, rootId);
        assertNotNull(doc);
        Set<Revision> revs = doc.getValueMap("prop").keySet();
        assertEquals(2, revs.size());
        assertTrue(revs.contains(r0));
        assertTrue(revs.contains(r2));
View Full Code Here

        NodeDocument.setRevision(op, r51, "c");
        NodeDocument.setPrevious(op, new Range(r42, r12, 0));
        NodeDocument.setPrevious(op, new Range(r31, r01, 0));
        store.createOrUpdate(NODES, op);

        NodeDocument doc = store.find(NODES, rootId);
        assertNotNull(doc);
        List<NodeDocument> prevDocs = Lists.newArrayList(
                doc.getPreviousDocs("p1", null));
        assertEquals(2, prevDocs.size());
        assertEquals(Utils.getPreviousIdFor(rootPath, r31, 0), prevDocs.get(0).getId());
View Full Code Here

        mk1.runBackgroundOperations();
        mk2.runBackgroundOperations();
        mk3.runBackgroundOperations();

        NodeDocument doc = ds.find(NODES, Utils.getIdFromPath("/test"));
        assertNotNull(doc);
        Map<Revision, String> revs = doc.getLocalRevisions();
        assertEquals(3, revs.size());
        revs = doc.getValueMap("_revisions");
        assertEquals(3 * NodeDocument.NUM_REVS_THRESHOLD, revs.size());
View Full Code Here

                    c.clear();
                    break;
                }
            }
            // read current value
            NodeDocument doc = ds.find(NODES, Utils.getIdFromPath("/test"));
            assertNotNull(doc);
            Revision head = ns.getHeadRevision();
            Revision lastRev = ns.getPendingModifications().get("/test");
            DocumentNodeState n = doc.getNodeAtRevision(mk.getNodeStore(), head, lastRev);
            assertNotNull(n);
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.