Package org.apache.jackrabbit.oak.plugins.segment

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


    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

        }

        // 2. init filestore
        FileStore restore = new FileStore(source, MAX_FILE_SIZE, false);
        try {
            Journal journal = restore.getJournal("root");
            SegmentNodeState state = new SegmentNodeState(restore.getWriter()
                    .getDummySegment(), journal.getHead());
            restore(state.getChildNode("root"), store);
        } finally {
            restore.close();
        }
    }
View Full Code Here

    }

    @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

    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

    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

    }

    @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

        }
    }

    @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

        return new URL(base, fragment).openConnection();
    }

    @Override
    public Journal getJournal(final String name) {
        return new Journal() {
            @Override
            public RecordId getHead() {
                try {
                    final URLConnection connection = get("j/" + name);
                    InputStream stream = connection.getInputStream();
View Full Code Here

        }

        // 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

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.segment.Journal

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.