use of com.hazelcast.internal.locksupport.LockSupportService in project hazelcast by hazelcast.
the class AbstractRecordStore method createLockStore.
protected LockStore createLockStore() {
NodeEngine nodeEngine = mapServiceContext.getNodeEngine();
LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);
if (lockService == null) {
return null;
}
return lockService.createLockStore(partitionId, MapService.getObjectNamespace(name));
}
use of com.hazelcast.internal.locksupport.LockSupportService in project hazelcast by hazelcast.
the class MultiMapContainer method destroy.
public void destroy() {
LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);
if (lockService != null) {
lockService.clearLockStore(partitionId, lockNamespace);
}
multiMapValues.clear();
}
use of com.hazelcast.internal.locksupport.LockSupportService in project hazelcast by hazelcast.
the class MultiMapService method init.
@Override
public void init(final NodeEngine nodeEngine, Properties properties) {
LockSupportService lockService = nodeEngine.getServiceOrNull(LockSupportService.SERVICE_NAME);
if (lockService != null) {
lockService.registerLockStoreConstructor(SERVICE_NAME, key -> {
String name = key.getObjectName();
final MultiMapConfig multiMapConfig = nodeEngine.getConfig().findMultiMapConfig(name);
return new LockStoreInfo() {
@Override
public int getBackupCount() {
return multiMapConfig.getBackupCount();
}
@Override
public int getAsyncBackupCount() {
return multiMapConfig.getAsyncBackupCount();
}
};
});
}
boolean dsMetricsEnabled = nodeEngine.getProperties().getBoolean(ClusterProperty.METRICS_DATASTRUCTURES);
if (dsMetricsEnabled) {
((NodeEngineImpl) nodeEngine).getMetricsRegistry().registerDynamicMetricsProvider(this);
}
}
Aggregations