Package org.apache.jackrabbit.mk.model

Examples of org.apache.jackrabbit.mk.model.MutableCommit


        pm.readNode(new StoredNode(id, null));
    }
   
    @Test
    public void testReplaceCommit() throws Exception {
        MutableCommit c1 = new MutableCommit();
        c1.setRootNodeId(Id.fromLong(0));
        pm.writeCommit(Id.fromLong(1), c1);

        MutableCommit c2 = new MutableCommit();
        c2.setParentId(c1.getId());
        c2.setRootNodeId(Id.fromLong(0));
        pm.writeCommit(Id.fromLong(2), c2);

        pm.start();
        c2 = new MutableCommit();
        c2.setRootNodeId(Id.fromLong(0));
        pm.replaceCommit(Id.fromLong(2), c2);
        pm.sweep();
       
        assertEquals(null, pm.readCommit(Id.fromLong(2)).getParentId());
    }
View Full Code Here


            return;
        }
       
        try {
            /* copy head commit */
            MutableCommit commitTo = new MutableCommit(rsFrom.getHeadCommit());
            commitTo.setParentId(rsTo.getHeadCommitId());

            rsTo.lockHead();
           
            try {
                rsTo.putHeadCommit(commitTo);
            } finally {
                rsTo.unlockHead();
            }
           
            /* now start putting all further changes to the "to" store */
            runState.set(STARTED);

            /* copy node hierarchy */
            copy(rsFrom.getNode(commitTo.getRootNodeId()));
           
        } catch (Exception e) {
            /* unable to perform GC */
            e.printStackTrace();
            runState.set(STOPPED);
View Full Code Here

            // assume virgin repository
            byte[] rawHead = longToBytes(++headCounter);
            head = new Id(rawHead);
           
            Id rootNodeId = pm.writeNode(new MutableNode(this, "/"));
            MutableCommit initialCommit = new MutableCommit();
            initialCommit.setCommitTS(System.currentTimeMillis());
            initialCommit.setRootNodeId(rootNodeId);
            pm.writeCommit(head, initialCommit);
            pm.writeHead(head);
        } else {
            headCounter = Long.parseLong(head.toString(), 16);
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.model.MutableCommit

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.