use of com.hazelcast.concurrent.lock.LockStoreInfo in project hazelcast by hazelcast.
the class MultiMapService method init.
@Override
public void init(final NodeEngine nodeEngine, Properties properties) {
int partitionCount = nodeEngine.getPartitionService().getPartitionCount();
for (int partition = 0; partition < partitionCount; partition++) {
partitionContainers[partition] = new MultiMapPartitionContainer(this, partition);
}
final LockService lockService = nodeEngine.getSharedService(LockService.SERVICE_NAME);
if (lockService != null) {
lockService.registerLockStoreConstructor(SERVICE_NAME, new ConstructorFunction<ObjectNamespace, LockStoreInfo>() {
@Override
public LockStoreInfo createNew(final ObjectNamespace key) {
String name = key.getObjectName();
final MultiMapConfig multiMapConfig = nodeEngine.getConfig().findMultiMapConfig(name);
return new LockStoreInfo() {
@Override
public int getBackupCount() {
return multiMapConfig.getSyncBackupCount();
}
@Override
public int getAsyncBackupCount() {
return multiMapConfig.getAsyncBackupCount();
}
};
}
});
}
}
Aggregations