use of org.janusgraph.graphdb.database.idassigner.StandardIDPool in project janusgraph by JanusGraph.
the class IDPoolTest method testStandardIDPool2.
@Test
public void testStandardIDPool2() throws InterruptedException {
final MockIDAuthority idAuthority = new MockIDAuthority(10000, Integer.MAX_VALUE, 2000);
testIDPoolWith(partitionID -> new StandardIDPool(idAuthority, partitionID, partitionID, Integer.MAX_VALUE, Duration.ofMillis(4000), 0.1), 2, 5, 10000);
}
use of org.janusgraph.graphdb.database.idassigner.StandardIDPool in project janusgraph by JanusGraph.
the class IDPoolTest method testStandardIDPool3.
@Test
public void testStandardIDPool3() throws InterruptedException {
final MockIDAuthority idAuthority = new MockIDAuthority(200);
testIDPoolWith(partitionID -> new StandardIDPool(idAuthority, partitionID, partitionID, Integer.MAX_VALUE, Duration.ofMillis(2000), 0.2), 10, 20, 100000);
}
use of org.janusgraph.graphdb.database.idassigner.StandardIDPool in project janusgraph by JanusGraph.
the class IDPoolTest method testPoolExhaustion1.
@Test
public void testPoolExhaustion1() {
MockIDAuthority idAuthority = new MockIDAuthority(200);
int idUpper = 10000;
StandardIDPool pool = new StandardIDPool(idAuthority, 0, 1, idUpper, Duration.ofMillis(2000), 0.2);
for (int i = 1; i < idUpper * 2; i++) {
try {
long id = pool.nextID();
assertTrue(id < idUpper);
} catch (IDPoolExhaustedException e) {
assertEquals(idUpper, i);
break;
}
}
}
Aggregations