Search in sources :

Example 1 with LockStoreInfo

use of com.hazelcast.internal.locksupport.LockStoreInfo 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);
    }
}
Also used : LockStoreInfo(com.hazelcast.internal.locksupport.LockStoreInfo) LockSupportService(com.hazelcast.internal.locksupport.LockSupportService) MultiMapConfig(com.hazelcast.config.MultiMapConfig) ConfigValidator.checkMultiMapConfig(com.hazelcast.internal.config.ConfigValidator.checkMultiMapConfig)

Aggregations

MultiMapConfig (com.hazelcast.config.MultiMapConfig)1 ConfigValidator.checkMultiMapConfig (com.hazelcast.internal.config.ConfigValidator.checkMultiMapConfig)1 LockStoreInfo (com.hazelcast.internal.locksupport.LockStoreInfo)1 LockSupportService (com.hazelcast.internal.locksupport.LockSupportService)1