Examples of Journal


Examples of org.apache.jackrabbit.core.journal.Journal

            throws ConfigurationException {
        return new JournalFactory() {
            public Journal getJournal(NamespaceResolver resolver)
                    throws RepositoryException {
                BeanConfig config = parseBeanConfig(cluster, JOURNAL_ELEMENT);
                Journal journal = config.newInstance(Journal.class);
                if (journal instanceof AbstractJournal) {
                    ((AbstractJournal) journal).setRepositoryHome(home);
                }
                try {
                    journal.init(id, resolver);
                } catch (JournalException e) {
                    // TODO: Should JournalException extend RepositoryException?
                    throw new RepositoryException(
                            "Journal initialization failed: " + journal, e);
                }
View Full Code Here

Examples of org.apache.jackrabbit.core.journal.Journal

            throws ConfigurationException {
        return new JournalFactory() {
            public Journal getJournal(NamespaceResolver resolver)
                    throws RepositoryException {
                BeanConfig config = parseBeanConfig(cluster, JOURNAL_ELEMENT);
                Journal journal = config.newInstance(Journal.class);
                if (journal instanceof AbstractJournal) {
                    ((AbstractJournal) journal).setRepositoryHome(home);
                }
                try {
                    journal.init(id, resolver);
                } catch (JournalException e) {
                    // TODO: Should JournalException extend RepositoryException?
                    throw new RepositoryException(
                            "Journal initialization failed: " + journal, e);
                }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

    }

    @Override
    public Journal getJournal(String name) {
        checkArgument("root".equals(name)); // only root supported for now
        return new Journal() {
            @Override
            public RecordId getHead() {
                return head.get();
            }
            @Override
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

    public void close() {
    }

    @Override
    public synchronized Journal getJournal(final String name) {
        Journal journal = journals.get(name);
        if (journal == null) {
            journal = new MemoryJournal(this, "root");
            journals.put(name, journal);
        }
        return journal;
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

        checkArgument(!"root".equals(name));

        DBObject id = new BasicDBObject("_id", name);
        state = journals.findOne(id, null, primaryPreferred());
        if (state == null) {
            Journal root = store.getJournal("root");
            String head = root.getHead().toString();
            state = new BasicDBObject(of(
                    "_id",    name,
                    "parent", "root",
                    "base",   head,
                    "head",   head));
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

            Segment segment = writer.getDummySegment();

            NodeState before = new SegmentNodeState(segment, base);
            NodeState after = new SegmentNodeState(segment, head);

            Journal parent = store.getJournal(state.get("parent").toString());
            while (!parent.setHead(base, head)) {
                RecordId newBase = parent.getHead();
                NodeBuilder builder =
                        new SegmentNodeState(segment, newBase).builder();
                after.compareAgainstBaseState(before, new MergeDiff(builder));
                RecordId newHead =
                        writer.writeNode(builder.getNodeState()).getRecordId();
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

    public void close() {
    }

    @Override
    public synchronized Journal getJournal(String name) {
        Journal journal = journals.get(name);
        if (journal == null) {
            journal = new MongoJournal(
                    this, db.getCollection("journals"), concern, name);
            journals.put(name, journal);
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

        }

        // 2. init filestore
        FileStore backup = new FileStore(destination, MAX_FILE_SIZE, false);
        try {
            Journal journal = backup.getJournal("root");

            SegmentNodeState state = new SegmentNodeState(
                    backup.getWriter().getDummySegment(), journal.getHead());
            SegmentNodeBuilder builder = state.builder();

            String beforeCheckpoint = state.getString("checkpoint");
            if (beforeCheckpoint == null) {
                // 3.1 no stored checkpoint, so do the initial full backup
                builder.setChildNode("root", current);
            } else {
                // 3.2 try to retrieve the previously backed up checkpoint
                NodeState before = store.retrieve(beforeCheckpoint);
                if (before != null) {
                    // the previous checkpoint is no longer available,
                    // so use the backed up state as the basis of the
                    // incremental backup diff
                    before = state.getChildNode("root");
                }
                current.compareAgainstBaseState(
                        before, new ApplyDiff(builder.child("root")));
            }
            builder.setProperty("checkpoint", checkpoint);

            // 4. commit the backup
            journal.setHead(
                    state.getRecordId(), builder.getNodeState().getRecordId());
        } finally {
            backup.close();
        }
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

        }
    }

    @Override
    public synchronized Journal getJournal(final String name) {
        Journal journal = journals.get(name);
        if (journal == null) {
            journal = new FileJournal(this, "root");
            journals.put(name, journal);
        }
        return journal;
View Full Code Here

Examples of org.apache.jackrabbit.oak.plugins.segment.Journal

    public void close() {
    }

    @Override
    public synchronized Journal getJournal(final String name) {
        Journal journal = journals.get(name);
        if (journal == null) {
            journal = new MemoryJournal(this, "root");
            journals.put(name, journal);
        }
        return journal;
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.