Package com.sleepycat.collections

Examples of com.sleepycat.collections.TransactionWorker


        final CurrentTransaction currentTxn =
            CurrentTransaction.getInstance(env);

        TransactionRunner runner = new TransactionRunner(env);
        try {
            runner.run(new TransactionWorker() {
                public void doWork()
                    throws Exception {

                    insertUntilOutOfMemory(currentTxn.getTransaction());
                }
View Full Code Here


        final Thread thread1 = new Thread(new Runnable() {
            public void run() {
                try {
                    /* The TransactionRunner performs retries. */
                    for (int i = 0; i < N_ITERS; i +=1 ) {
                        runner.run(new TransactionWorker() {
                            public void doWork() throws Exception {
                                assertEquals(null, storeMap.put(N_ONE, N_101));
                            }
                        });
                        runner.run(new TransactionWorker() {
                            public void doWork() throws Exception {
                                assertEquals(N_101, storeMap.remove(N_ONE));
                            }
                        });
                    }
View Full Code Here

            try {
                final TransactionRunner runner = new TransactionRunner(env);
                final Object thread = this;
                assertNull(currentTxn.getTransaction());

                runner.run(new TransactionWorker() {
                    public void doWork() throws Exception {
                        assertNotNull(currentTxn.getTransaction());
                        readCheck(map, TWO, null);
                        synchronized (parent) { parent.notify(); }
                        thread.wait();
View Full Code Here

    }

    void addAll()
        throws Exception {

        writeRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                assertTrue(imap.isEmpty());
                Iterator iter = imap.entrySet().iterator();
                try {
                    assertTrue(!iter.hasNext());
View Full Code Here

    }

    void appendAll()
        throws Exception {

        writeRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                assertTrue(imap.isEmpty());

                TestKeyAssigner keyAssigner = testStore.getKeyAssigner();
                if (keyAssigner != null) {
View Full Code Here

    }

    void updateAll()
        throws Exception {

        writeRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                for (int i = beginKey; i <= endKey; i += 1) {
                    Long key = makeKey(i);
                    Object val = makeVal(i);
                    if (!imap.areDuplicatesAllowed()) {
View Full Code Here

    }

    void updateIter(final Collection coll)
        throws Exception {

        writeIterRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                ListIterator iter = (ListIterator) coll.iterator();
                try {
                    for (int i = beginKey; i <= endKey; i += 1) {
                        assertTrue(iter.hasNext());
View Full Code Here

    }

    void removeAll()
        throws Exception {

        writeIterRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                assertTrue(!map.isEmpty());
                ListIterator iter = null;
                try {
                    if (list != null) {
View Full Code Here

    }

    void clearAll()
        throws Exception {

        writeRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                map.clear();
                assertTrue(map.isEmpty());
            }
        });
View Full Code Here

    }

    void removeOdd()
        throws Exception {

        writeRunner.run(new TransactionWorker() {
            public void doWork() throws Exception {
                boolean toggle = false;
                for (int i = beginKey; i <= endKey; i += 2) {
                    toggle = !toggle;
                    Long key = makeKey(i);
View Full Code Here

TOP

Related Classes of com.sleepycat.collections.TransactionWorker

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.