use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class MapLockTest method lockStoreShouldBeRemoved_whenMapIsDestroyed.
/**
* See issue #4888
*/
@Test
public void lockStoreShouldBeRemoved_whenMapIsDestroyed() {
HazelcastInstance instance = createHazelcastInstance(getConfig());
IMap<Integer, Integer> map = instance.getMap(randomName());
for (int i = 0; i < 1000; i++) {
map.lock(i);
}
map.destroy();
NodeEngineImpl nodeEngine = getNodeEngineImpl(instance);
LockServiceImpl lockService = nodeEngine.getService(LockService.SERVICE_NAME);
int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int i = 0; i < partitionCount; i++) {
LockStoreContainer lockContainer = lockService.getLockContainer(i);
assertEquals("LockStores should be empty", 0, lockContainer.getLockStores().size());
}
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class MapMergePolicyQuickTest method getMapServiceContext.
private MapServiceContext getMapServiceContext(HazelcastInstance instance) {
NodeEngineImpl nodeEngine = HazelcastTestSupport.getNodeEngineImpl(instance);
MapService mapService = nodeEngine.getService(MapService.SERVICE_NAME);
return mapService.getMapServiceContext();
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class NearCacheTestSupport method getNearCache.
protected NearCache getNearCache(String mapName, HazelcastInstance instance) {
NodeEngineImpl nodeEngine = getNode(instance).nodeEngine;
MapService service = nodeEngine.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = service.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
NearCacheConfig nearCacheConfig = nodeEngine.getConfig().getMapConfig(mapName).getNearCacheConfig();
return mapNearCacheManager.getOrCreateNearCache(mapName, nearCacheConfig);
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class InvalidationMetadataDistortionTest method distortRandomPartitionUuid.
private void distortRandomPartitionUuid(HazelcastInstance member) {
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(member);
int partitionCount = nodeEngineImpl.getPartitionService().getPartitionCount();
int partitionId = getInt(partitionCount);
MapService mapService = nodeEngineImpl.getService(SERVICE_NAME);
MapServiceContext mapServiceContext = mapService.getMapServiceContext();
MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager();
Invalidator invalidator = mapNearCacheManager.getInvalidator();
MetaDataGenerator metaDataGenerator = invalidator.getMetaDataGenerator();
metaDataGenerator.setUuid(partitionId, UuidUtil.newSecureUUID());
}
use of com.hazelcast.spi.impl.NodeEngineImpl in project hazelcast by hazelcast.
the class NonStopInvalidatorTest method setUp.
@Before
public void setUp() {
key = mock(Data.class);
HazelcastInstance hz = createHazelcastInstance();
NodeEngineImpl nodeEngineImpl = getNodeEngineImpl(hz);
invalidator = new NonStopInvalidator(MapService.SERVICE_NAME, TRUE_FILTER, nodeEngineImpl);
}
Aggregations