Search in sources :

Example 1 with ObjLongConsumer

use of java.util.function.ObjLongConsumer in project neo4j by neo4j.

the class ConfigurableIOLimiterTest method createIOLimiter.

private void createIOLimiter(Config config) {
    pauseNanosCounter = new AtomicLong();
    ObjLongConsumer<Object> pauseNanos = (blocker, nanos) -> pauseNanosCounter.getAndAdd(nanos);
    limiter = new ConfigurableIOLimiter(config, pauseNanos);
}
Also used : Config(org.neo4j.kernel.configuration.Config) Test(org.junit.Test) IOException(java.io.IOException) IOLimiter(org.neo4j.io.pagecache.IOLimiter) TimeUnit(java.util.concurrent.TimeUnit) Assert.assertThat(org.junit.Assert.assertThat) AtomicLong(java.util.concurrent.atomic.AtomicLong) ObjLongConsumer(java.util.function.ObjLongConsumer) Map(java.util.Map) Matchers.greaterThan(org.hamcrest.Matchers.greaterThan) Matchers.is(org.hamcrest.Matchers.is) GraphDatabaseSettings(org.neo4j.graphdb.factory.GraphDatabaseSettings) MapUtil.stringMap(org.neo4j.helpers.collection.MapUtil.stringMap) Flushable(java.io.Flushable) AtomicLong(java.util.concurrent.atomic.AtomicLong)

Aggregations

Flushable (java.io.Flushable)1 IOException (java.io.IOException)1 Map (java.util.Map)1 TimeUnit (java.util.concurrent.TimeUnit)1 AtomicLong (java.util.concurrent.atomic.AtomicLong)1 ObjLongConsumer (java.util.function.ObjLongConsumer)1 Matchers.greaterThan (org.hamcrest.Matchers.greaterThan)1 Matchers.is (org.hamcrest.Matchers.is)1 Assert.assertThat (org.junit.Assert.assertThat)1 Test (org.junit.Test)1 GraphDatabaseSettings (org.neo4j.graphdb.factory.GraphDatabaseSettings)1 MapUtil.stringMap (org.neo4j.helpers.collection.MapUtil.stringMap)1 IOLimiter (org.neo4j.io.pagecache.IOLimiter)1 Config (org.neo4j.kernel.configuration.Config)1