Package org.apache.jackrabbit.mk.model

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


            byte[] rawHead = Id.fromLong(commitCounter.incrementAndGet())
                    .getBytes();
            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 {
            Id lastCommitId = head;
            if (ids[1] != null && ids[1].compareTo(lastCommitId) > 0) {
View Full Code Here


                firstCommitId = firstBranchRootId;
            }
            /* repair dangling parent commit of first preserved commit */
            StoredCommit commit = getCommit(firstCommitId);
            if (commit.getParentId() != null) {
                MutableCommit firstCommit = new MutableCommit(commit);
                firstCommit.setParentId(null);
                gcpm.replaceCommit(firstCommit.getId(), firstCommit);
            }
           
        } catch (Exception e) {
            /* unable to perform GC */
            LOG.error("Exception occurred in GC cycle", e);
View Full Code Here

            byte[] rawHead = Id.fromLong(commitCounter.incrementAndGet())
                    .getBytes();
            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 {
            Id lastCommitId = head;
            if (ids[1] != null && ids[1].compareTo(lastCommitId) > 0) {
View Full Code Here

                firstCommitId = firstBranchRootId;
            }
            /* repair dangling parent commit of first preserved commit */
            StoredCommit commit = getCommit(firstCommitId);
            if (commit.getParentId() != null) {
                MutableCommit firstCommit = new MutableCommit(commit);
                firstCommit.setParentId(null);
                gcpm.replaceCommit(firstCommit.getId(), firstCommit);
            }
           
        } catch (Exception e) {
            /* unable to perform GC */
            LOG.error("Exception occurred in GC cycle", e);
View Full Code Here

            byte[] rawHead = Id.fromLong(commitCounter.incrementAndGet())
                    .getBytes();
            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 {
            Id lastCommitId = head;
            if (ids[1] != null && ids[1].compareTo(lastCommitId) > 0) {
View Full Code Here

                firstCommitId = firstBranchRootId;
            }
            /* repair dangling parent commit of first preserved commit */
            StoredCommit commit = getCommit(firstCommitId);
            if (commit.getParentId() != null) {
                MutableCommit firstCommit = new MutableCommit(commit);
                firstCommit.setParentId(null);
                gcpm.replaceCommit(firstCommit.getId(), firstCommit);
            }
           
        } catch (Exception e) {
            /* unable to perform GC */
            LOG.error("Exception occurred in GC cycle", e);
View Full Code Here

            byte[] rawHead = Id.fromLong(commitCounter.incrementAndGet())
                    .getBytes();
            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 {
            commitCounter.set(Long.parseLong(head.toString(), 16));
        }
View Full Code Here

                firstCommitId = firstBranchRootId;
            }
            /* repair dangling parent commit of first preserved commit */
            StoredCommit commit = getCommit(firstCommitId);
            if (commit.getParentId() != null) {
                MutableCommit firstCommit = new MutableCommit(commit);
                firstCommit.setParentId(null);
                gcpm.replaceCommit(firstCommit.getId(), firstCommit);
            }
           
        } catch (Exception e) {
            /* unable to perform GC */
            gcState.set(NOT_ACTIVE);
View Full Code Here

        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

            byte[] rawHead = Id.fromLong(commitCounter.incrementAndGet())
                    .getBytes();
            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 {
            commitCounter.set(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.