Search in sources :

Example 11 with DistributedLockService

use of org.apache.geode.distributed.DistributedLockService in project geode by apache.

the class AutoBalancerIntegrationJUnitTest method canReacquireLock.

@Test
public void canReacquireLock() throws InterruptedException {
    acquireLockInDifferentThread(2);
    DistributedLockService dls = new GeodeCacheFacade().getDLS();
    assertFalse(dls.lock(AutoBalancer.AUTO_BALANCER_LOCK, 0, -1));
}
Also used : GeodeCacheFacade(org.apache.geode.cache.util.AutoBalancer.GeodeCacheFacade) DistributedLockService(org.apache.geode.distributed.DistributedLockService) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Example 12 with DistributedLockService

use of org.apache.geode.distributed.DistributedLockService in project geode by apache.

the class AutoBalancerIntegrationJUnitTest method testLockSuccess.

@Test
public void testLockSuccess() throws InterruptedException {
    acquireLockInDifferentThread(1);
    DistributedLockService dls = new GeodeCacheFacade().getDLS();
    assertFalse(dls.lock(AutoBalancer.AUTO_BALANCER_LOCK, 0, -1));
}
Also used : GeodeCacheFacade(org.apache.geode.cache.util.AutoBalancer.GeodeCacheFacade) DistributedLockService(org.apache.geode.distributed.DistributedLockService) Test(org.junit.Test) IntegrationTest(org.apache.geode.test.junit.categories.IntegrationTest)

Aggregations

DistributedLockService (org.apache.geode.distributed.DistributedLockService)12 GeodeCacheFacade (org.apache.geode.cache.util.AutoBalancer.GeodeCacheFacade)3 IntegrationTest (org.apache.geode.test.junit.categories.IntegrationTest)3 Test (org.junit.Test)3 DistributedMemberLock (org.apache.geode.distributed.internal.locks.DistributedMemberLock)2 IOException (java.io.IOException)1 UnknownHostException (java.net.UnknownHostException)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 CacheException (org.apache.geode.cache.CacheException)1 RegionDirectory (org.apache.geode.cache.lucene.internal.directory.RegionDirectory)1 IndexRepository (org.apache.geode.cache.lucene.internal.repository.IndexRepository)1 IndexRepositoryImpl (org.apache.geode.cache.lucene.internal.repository.IndexRepositoryImpl)1 CacheOperationFacade (org.apache.geode.cache.util.AutoBalancer.CacheOperationFacade)1 DistributedSystemDisconnectedException (org.apache.geode.distributed.DistributedSystemDisconnectedException)1 LockServiceDestroyedException (org.apache.geode.distributed.LockServiceDestroyedException)1 BucketRegion (org.apache.geode.internal.cache.BucketRegion)1 PartitionedRegion (org.apache.geode.internal.cache.PartitionedRegion)1 SystemManagementService (org.apache.geode.management.internal.SystemManagementService)1 IgnoredException (org.apache.geode.test.dunit.IgnoredException)1 IndexWriter (org.apache.lucene.index.IndexWriter)1