Package com.sleepycat.je

Examples of com.sleepycat.je.SequenceStats


        txn = txnBegin();

        /* Check default values before calling get(). */

        SequenceStats stats = seq.getStats(null);
        assertEquals(0, stats.getCurrent());
        assertEquals(0, stats.getCacheSize());
        assertEquals(0, stats.getNGets());
        assertEquals(Long.MIN_VALUE, stats.getMin());
        assertEquals(Long.MAX_VALUE, stats.getMax());

        /* Get the first value. */

        long val = seq.get(txn, 1);
        assertEquals(0, val);
        stats = seq.getStats(null);
        assertEquals(1, stats.getCurrent());
        assertEquals(1, stats.getValue());
        assertEquals(0, stats.getLastValue());
        assertEquals(1, stats.getNGets());

        /* Use deltas greater than one. */

        assertEquals(1, seq.get(txn, 2));
        assertEquals(3, seq.get(txn, 3));
View Full Code Here


        txn = txnBegin();
        Sequence seq2 = db.openSequence(txn, key, config);
        assertEquals(2, seq2.get(txn, 1));
        txnCommit(txn);

        SequenceStats stats = seq2.getStats(null);
        assertEquals(1, stats.getCurrent());
        assertEquals(1, stats.getMin());
        assertEquals(3, stats.getMax());

        /* Values are assigned from a single sequence for both handles. */

        assertEquals(1, seq.get(null, 1));

View Full Code Here

        }

        StatsConfig clearConfig = new StatsConfig();
        clearConfig.setFast(true);
        clearConfig.setClear(true);
        SequenceStats stats = seq.getStats(clearConfig);

        assertEquals(msg, 1, stats.getNGets());
        assertEquals(msg, expectCached ? 1 : 0, stats.getNCachedGets());
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.je.SequenceStats

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.