Package com.thinkaurelius.titan.graphdb.database.idassigner

Examples of com.thinkaurelius.titan.graphdb.database.idassigner.StandardIDPool$IDBlockThread


    public void testStandardIDPool1() throws InterruptedException {
        final MockIDAuthority idauth = new MockIDAuthority(200);
        testIDPoolWith(new IDPoolFactory() {
            @Override
            public StandardIDPool get(long partitionID) {
                return new StandardIDPool(idauth, partitionID, Integer.MAX_VALUE, 2000, 0.2);
            }
        }, 1000, 6, 100000);
    }
View Full Code Here


        final MockIDAuthority idauth = new MockIDAuthority(10000);
        idauth.setDelayAcquisition(2000);
        testIDPoolWith(new IDPoolFactory() {
            @Override
            public StandardIDPool get(long partitionID) {
                return new StandardIDPool(idauth, partitionID, Integer.MAX_VALUE, 4000, 0.1);
            }
        }, 2, 5, 10000);
    }
View Full Code Here

    public void testStandardIDPool3() throws InterruptedException {
        final MockIDAuthority idauth = new MockIDAuthority(200);
        testIDPoolWith(new IDPoolFactory() {
            @Override
            public StandardIDPool get(long partitionID) {
                return new StandardIDPool(idauth, partitionID, Integer.MAX_VALUE, 2000, 0.2);
            }
        }, 10, 20, 100000);
    }
View Full Code Here

    @Test
    public void testAllocationTimeout() {
        final MockIDAuthority idauth = new MockIDAuthority(10000);
        idauth.setDelayAcquisition(5000);
        StandardIDPool pool = new StandardIDPool(idauth, 1, Integer.MAX_VALUE, 4000, 0.1);
        try {
            pool.nextID();
            fail();
        } catch (TitanException e) {

        }
View Full Code Here

    @Test
    public void testPoolExhaustion1() {
        MockIDAuthority idauth = new MockIDAuthority(200);
        int maxID = 10000;
        StandardIDPool pool = new StandardIDPool(idauth, 0, maxID, 2000, 0.2);
        for (int i = 1; i < maxID * 2; i++) {
            try {
                long id = pool.nextID();
                assertTrue(id <= maxID);
            } catch (IDPoolExhaustedException e) {
                assertEquals(maxID + 1, i);
                break;
            }
View Full Code Here

    @Test
    public void testPoolExhaustion2() {
        int maxID = 10000;
        MockIDAuthority idauth = new MockIDAuthority(200, maxID + 1);
        StandardIDPool pool = new StandardIDPool(idauth, 0, Integer.MAX_VALUE, 2000, 0.2);
        for (int i = 1; i < maxID * 2; i++) {
            try {
                long id = pool.nextID();
                assertTrue(id <= maxID);
            } catch (IDPoolExhaustedException e) {
                assertEquals(maxID + 1, i);
                break;
            }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.graphdb.database.idassigner.StandardIDPool$IDBlockThread

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.