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

Examples of org.apache.jackrabbit.oak.plugins.segment.file.FileStore


            DocumentNodeStore store = new DocumentMK.Builder().
                    setMongoDB(mongo.getDB()).
                    setClusterId(clusterId.value(options)).getNodeStore();
            fixture = new MongoFixture(store);
        } else {
            fixture = new SegmentFixture(new FileStore(
                    new File(nonOptions.get(0)), 256));
        }
       
       
View Full Code Here


        RecordId r = new RecordId(id, newValidOffset(random));
        return r;
    }

    public static void assertEqualStores(File d1, File d2) throws IOException {
        FileStore f1 = new FileStore(d1, 1, false);
        FileStore f2 = new FileStore(d2, 1, false);
        try {
            assertEquals(f1.getHead(), f2.getHead());
        } finally {
            f1.close();
            f2.close();
        }
    }
View Full Code Here

    }

    @Parameterized.Parameters
    public static Collection<Object[]> fixtures() throws IOException {
        File file = new File(new File("target"), "tar." + System.nanoTime());
        SegmentStore segmentStore = new FileStore(file, 266, true);

        List<Object[]> fixtures = Lists.newArrayList();
        SegmentFixture segmentFixture = new SegmentFixture(segmentStore);
        if (segmentFixture.isAvailable()) {
            fixtures.add(new Object[] {segmentFixture, SEGMENT_SCALES});
View Full Code Here

        Session session = null;
        try {
            File directory =
                    new File("target", "tarmk-" + System.currentTimeMillis());
            this.store = new FileStore(directory, 1, false);
            Jcr jcr = new Jcr(new Oak(new SegmentNodeStore(store)));
            QueryEngineSettings qs = new QueryEngineSettings();
            qs.setFullTextComparisonWithoutIndex(true);
            jcr.with(qs);
            preCreateRepository(jcr);
View Full Code Here

        Session session = null;
        try {
            File directory =
                    new File("target", "tarmk-" + System.currentTimeMillis());
            this.store = new FileStore(directory, 1, false);
            Jcr jcr = new Jcr(new Oak(new SegmentNodeStore(store)));
            preCreateRepository(jcr);
            this.repository = jcr.createRepository();

            session = getRepository().login(superuser);
View Full Code Here

            throw new IOException("Folder " + source
                    + " is not a valid FileStore directory");
        }

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

    }

    @Parameterized.Parameters
    public static Collection<Object[]> fixtures() throws IOException {
        File file = new File(new File("target"), "tar." + System.nanoTime());
        SegmentStore segmentStore = new FileStore(file, 266, true);

        List<Object[]> fixtures = Lists.newArrayList();
        SegmentFixture segmentFixture = new SegmentFixture(segmentStore);
        if (segmentFixture.isAvailable()) {
            fixtures.add(new Object[] {segmentFixture, SEGMENT_SCALES});
View Full Code Here

            // unable to retrieve the checkpoint; use root state instead
            current = store.getRoot();
        }

        // 2. init filestore
        FileStore backup = new FileStore(destination, MAX_FILE_SIZE, false);
        try {
            SegmentNodeState state = backup.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
            backup.setHead(state, builder.getNodeState());
        } finally {
            backup.close();
        }

        log.debug("Backup finished in {} ms.", System.currentTimeMillis() - s);
    }
View Full Code Here

        String size = lookup(context, SIZE);
        if (size == null) {
            size = System.getProperty(SIZE, "256");
        }

        store = new FileStore(
                blobStore,
                new File(directory),
                Integer.parseInt(size), "64".equals(mode));

        delegate = new SegmentNodeStore(store);
View Full Code Here

        if (properties.get(DIRECTORY) != null) {
            String directory = properties.get(DIRECTORY).toString();

            mongo = null;
            store[0] = new FileStore(directory);
        } else {
            String host = String.valueOf(properties.get(HOST));
            int port = Integer.parseInt(String.valueOf(properties.get(PORT)));
            String db = String.valueOf(properties.get(DB));
            int cache = Integer.parseInt(String.valueOf(properties.get(CACHE)));
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.segment.file.FileStore

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.