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

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


    private void createTestWithConfig(String[] ipRanges, boolean expectedToWork) throws Exception {
        createTestWithConfig("127.0.0.1", ipRanges, expectedToWork);
    }

    private void createTestWithConfig(String host, String[] ipRanges, boolean expectedToWork) throws Exception {
        NodeStore store = new SegmentNodeStore(storeS);
        final StandbyServer server = new StandbyServer(port, storeS, ipRanges);
        server.start();
        addTestContent(store, "server");
        storeS.flush()// this speeds up the test a little bit...
View Full Code Here


        test(number, minExpectedSegments, maxExpectedSegments, minExpectedBytes, maxExpectedBytes, false);
    }

    private void test(int number, int minExpectedSegments, int maxExpectedSegments, long minExpectedBytes, long maxExpectedBytes,
                      boolean useSSL) throws Exception {
        NodeStore store = new SegmentNodeStore(storeS);
        NodeBuilder rootbuilder = store.getRoot().builder();
        NodeBuilder b = rootbuilder.child("store");
        for (int j=0; j<=number / 1000; j++) {
            NodeBuilder builder = b.child("Folder#" + j);
            for (int i = 0; i <(number < 1000 ? number : 1000); i++) {
                builder.child("Test#" + i).setProperty("ts", System.currentTimeMillis());
            }
        }
        store.merge(rootbuilder, EmptyHook.INSTANCE, CommitInfo.EMPTY);
        storeS.flush();

        final StandbyServer server = new StandbyServer(port, storeS, useSSL);
        server.start();
View Full Code Here

    }

    @Test
    public void testBrokenConnection() throws Exception {

        NodeStore store = new SegmentNodeStore(storeS);
        DebugSegmentStore s = new DebugSegmentStore(storeS);
        final StandbyServer server = new StandbyServer(port, s);
        s.createReadErrors = true;
        server.start();
        addTestContent(store, "server");
View Full Code Here

    }

    @Test
    public void testLocalChanges() throws Exception {

        NodeStore store = new SegmentNodeStore(storeC);
        addTestContent(store, "client");

        final StandbyServer server = new StandbyServer(port, storeS);
        server.start();
        store = new SegmentNodeStore(storeS);
        addTestContent(store, "server");
        storeS.flush();

        StandbyClient cl = new StandbyClient("127.0.0.1", port, storeC);
        try {
View Full Code Here

        NetworkErrorProxy p = new NetworkErrorProxy(PROXY_PORT, LOCALHOST, port);
        p.skipBytes(skipPosition, skipBytes);
        p.flipByte(flipPosition);
        p.run();

        NodeStore store = new SegmentNodeStore(storeS);
        final StandbyServer server = new StandbyServer(port, storeS, ssl);
        server.start();
        addTestContent(store, "server");
        storeS.flush()// this speeds up the test a little bit...
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);
            this.repository = jcr.createRepository();
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);
            TestContentLoader loader = new TestContentLoader();
View Full Code Here

        return true;
    }

    @Override
    public void setUpCluster(MicroKernel[] cluster) {
        NodeStore store = new SegmentNodeStore(new MemoryStore());
        MicroKernel mk = new NodeStoreKernel(store);
        for (int i = 0; i < cluster.length; i++) {
            cluster[i] = mk;
        }
    }
View Full Code Here

            this.store = store;
        }

        @Override
        public NodeStore createNodeStore() {
            return new SegmentNodeStore(store == null ? new MemoryStore() : store);
        }
View Full Code Here

                Repository[] cluster = new Repository[n];
                stores = new SegmentStore[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

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStore$Commit

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.