use of org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer in project infinispan by infinispan.
the class AsyncStoreStressTest method startMarshaller.
@BeforeClass(alwaysRun = true)
void startMarshaller() {
marshaller = new TestObjectStreamMarshaller();
location = CommonsTestingUtil.tmpDirectory(this.getClass());
nonBlockingExecutor = new ThreadPoolExecutor(0, ProcessorInfo.availableProcessors() * 2, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(KnownComponentNames.getDefaultQueueSize(KnownComponentNames.NON_BLOCKING_EXECUTOR)), new NonBlockingThreadFactory("ISPN-non-blocking-thread-group", Thread.NORM_PRIORITY, DefaultThreadFactory.DEFAULT_PATTERN, "Test", "non-blocking"), NonBlockingRejectedExecutionHandler.getInstance());
blockingExecutor = new ThreadPoolExecutor(0, 150, 60L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(KnownComponentNames.getDefaultQueueSize(KnownComponentNames.BLOCKING_EXECUTOR)), getTestThreadFactory("Blocking"), BlockingRejectedExecutionHandler.getInstance());
PerKeyLockContainer lockContainer = new PerKeyLockContainer();
TestingUtil.inject(lockContainer, new DefaultTimeService());
locks = lockContainer;
timeService = new DefaultTimeService();
TestingUtil.inject(locks, timeService, nonBlockingExecutor);
}
use of org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer in project infinispan by infinispan.
the class LockContainerTest method testSingleCounterTestPerEntry.
public void testSingleCounterTestPerEntry() throws ExecutionException, InterruptedException {
PerKeyLockContainer lockContainer = new PerKeyLockContainer();
TestingUtil.inject(lockContainer, AbstractCacheTest.TIME_SERVICE);
doSingleCounterTest(lockContainer, -1);
}
use of org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer in project infinispan by infinispan.
the class LockManagerTest method testSingleCounterPerKey.
public void testSingleCounterPerKey() throws ExecutionException, InterruptedException {
DefaultLockManager lockManager = new DefaultLockManager();
PerKeyLockContainer lockContainer = new PerKeyLockContainer();
TestingUtil.inject(lockContainer, AbstractCacheTest.TIME_SERVICE);
TestingUtil.inject(lockManager, lockContainer, named(NON_BLOCKING_EXECUTOR, asyncExecutor), named(TIMEOUT_SCHEDULE_EXECUTOR, mockScheduledExecutor));
doSingleCounterTest(lockManager);
}
use of org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer in project infinispan by infinispan.
the class LockContainerTest method testSingleLockWithPerEntry.
public void testSingleLockWithPerEntry() throws InterruptedException {
PerKeyLockContainer lockContainer = new PerKeyLockContainer();
TestingUtil.inject(lockContainer, AbstractCacheTest.TIME_SERVICE);
doSingleLockTest(lockContainer, -1);
}
use of org.infinispan.util.concurrent.locks.impl.PerKeyLockContainer in project infinispan by infinispan.
the class LockManagerTest method testTimeoutPerKey.
public void testTimeoutPerKey() throws ExecutionException, InterruptedException {
DefaultLockManager lockManager = new DefaultLockManager();
PerKeyLockContainer lockContainer = new PerKeyLockContainer();
TestingUtil.inject(lockContainer, AbstractCacheTest.TIME_SERVICE);
TestingUtil.inject(lockManager, lockContainer, asyncExecutor, mockScheduledExecutor);
doTestWithFailAcquisition(lockManager);
}
Aggregations