Examples of SegmentNodeStore


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

    private Session session;
    private VersionManager vMgr;

    @Before
    public void before() throws Exception {
        store = new SegmentNodeStore(new MemoryStore());
        repo = new Jcr(store).createRepository();
        session = repo.login(new SimpleCredentials("admin", "admin".toCharArray()));
        vMgr = session.getWorkspace().getVersionManager();
    }
View Full Code Here

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

    @Test
    public void testBackup() throws Exception {
        FileStore source = new FileStore(src, 256, false);

        NodeStore store = new SegmentNodeStore(source);
        init(store);

        // initial content
        FileStoreBackup.backup(store, destination);
View Full Code Here

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

    @Test
    public void testRestore() throws Exception {
        FileStore source = new FileStore(src, 256, false);

        NodeStore store = new SegmentNodeStore(source);
        init(store);

        // initial content
        FileStoreBackup.backup(store, destination);
View Full Code Here

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

    }

    private static void compare(NodeStore store, File destination)
            throws IOException {
        FileStore backup = new FileStore(destination, 256, false);
        assertEquals(store.getRoot(), new SegmentNodeStore(backup).getRoot());
        backup.close();
    }
View Full Code Here

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

    @Test @Ignore("OAK-1159 duplicate content")
    public void testSharedContent() throws Exception {
        FileStore source = new FileStore(src, 256, false);

        NodeStore store = new SegmentNodeStore(source);

        // ~100k
        Blob blob = store.createBlob(new ByteArrayInputStream(new byte[100000]));

        NodeBuilder builder = store.getRoot().builder();
        NodeBuilder c1 = builder.child("test-backup");
        c1.setProperty("blob", blob);
        NodeBuilder c2 = builder.child("test-backup2");
        c2.setProperty("blob", blob);
        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        FileStoreBackup.backup(store, destination);
        compare(store, destination);
        source.close();
View Full Code Here

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

                Repository[] cluster = new Repository[n];
                stores = new FileStore[cluster.length];
                mongo = new Mongo(host, port);
                for (int i = 0; i < cluster.length; i++) {
                    stores[i] = new MongoStore(mongo.getDB(unique), cacheSize);
                    Oak oak = new Oak(new SegmentNodeStore(stores[i]));
                    cluster[i] = new Jcr(oak).createRepository();
                }
                return cluster;
            }
            @Override
View Full Code Here

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

            public Repository[] setUpCluster(int n) throws Exception {
                Repository[] cluster = new Repository[n];
                stores = new FileStore[cluster.length];
                for (int i = 0; i < cluster.length; i++) {
                    stores[i] = new FileStore(new File(base, unique));
                    Oak oak = new Oak(new SegmentNodeStore(stores[i]));
                    cluster[i] = new Jcr(oak).createRepository();
                }
                return cluster;
            }
            @Override
View Full Code Here

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

        super(settings);

        Session session = null;
        try {
            this.connection = new Mongo(HOST, PORT);
            Jcr jcr = new Jcr(new Oak(new SegmentNodeStore(
                    new MongoStore(connection.getDB(DB), 100 * 1024 * 1024))));
            jcr.with(Executors.newScheduledThreadPool(1));
            this.repository = jcr.createRepository();

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

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

    private static void backup(String[] args) throws IOException {
        if (args.length == 2) {
            // TODO: enable backup for other node store implementations
            FileStore store = new FileStore(new File(args[0]), 256, false);
            FileStoreBackup.backup(new SegmentNodeStore(store), new File(args[1]));
            store.close();
        } else {
            System.err.println("usage: backup <repository> <backup>");
            System.exit(1);
        }
View Full Code Here

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

                        client.close();
                    }
                } else {
                    FileStore store = new FileStore(new File(dst), 256);
                    try {
                        NodeStore target = new SegmentNodeStore(store);
                        RepositoryUpgrade upgrade =
                                new RepositoryUpgrade(source, target);
                        upgrade.setCopyBinariesByReference(
                                options.has("datastore"));
                        upgrade.copy(null);
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.