Package com.foundationdb.server.test.mt.util

Examples of com.foundationdb.server.test.mt.util.ConcurrentTestBuilder


        int tid = createTable("test", "t", "id INT NOT NULL PRIMARY KEY, x INT");
        rowType = SchemaCache.globalSchema(ais()).tableRowType(tid);
    }

    private void run(int threadCount) {
        ConcurrentTestBuilder builder = ConcurrentTestBuilderImpl.create();
        int perThread = ROW_COUNT / threadCount;
        for(int i = 0; i < threadCount; ++i) {
            builder.add("thread_"+i, insertCreator(rowType, 1 + i * perThread, perThread))
                   .sync("a", Stage.PRE_BEGIN);
        }
        List<MonitoredThread> threads = builder.build(this);
        ThreadHelper.runAndCheck(TIMEOUT,threads);
    }
View Full Code Here


        tid = createTable("test", "t", "id INT NOT NULL PRIMARY KEY, x INT NULL, UNIQUE(x)");
        rowType = SchemaCache.globalSchema(ais()).tableRowType(tid);
    }

    private List<MonitoredThread> buildThreads(Integer x1, Integer x2) {
        ConcurrentTestBuilder builder = ConcurrentTestBuilderImpl.create();
        builder.add("insert_a", insertCreator(tid, testRow(rowType, 1, x1)))
               .sync("sync", Stage.POST_BEGIN)
               .add("insert_b", insertCreator(tid, testRow(rowType, 2, x2)))
               .sync("sync", Stage.POST_BEGIN);
        return builder.build(this);
    }
View Full Code Here

TOP

Related Classes of com.foundationdb.server.test.mt.util.ConcurrentTestBuilder

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.