default:
throw new IllegalArgumentException("Invalid storage format: " + mapConfig.getInMemoryFormat());
}
MapStoreConfig mapStoreConfig = mapConfig.getMapStoreConfig();
if (mapStoreConfig != null && mapStoreConfig.isEnabled()) {
try {
MapStoreFactory factory = (MapStoreFactory) mapStoreConfig.getFactoryImplementation();
if (factory == null) {
String factoryClassName = mapStoreConfig.getFactoryClassName();
if (factoryClassName != null && !"".equals(factoryClassName)) {
factory = ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(), factoryClassName);
}
}
store = (factory == null ? mapStoreConfig.getImplementation() :
factory.newMapStore(name, mapStoreConfig.getProperties()));
if (store == null) {
String mapStoreClassName = mapStoreConfig.getClassName();
store = ClassLoaderUtil.newInstance(nodeEngine.getConfigClassLoader(), mapStoreClassName);
}
} catch (Exception e) {
throw ExceptionUtil.rethrow(e);
}
storeWrapper = new MapStoreWrapper(store, name, mapStoreConfig.isEnabled());
} else {
storeWrapper = null;
}
if (storeWrapper != null) {
if (store instanceof MapLoaderLifecycleSupport) {
((MapLoaderLifecycleSupport) store).init(nodeEngine.getHazelcastInstance(),
mapStoreConfig.getProperties(), name);
}
loadInitialKeys();
if (mapStoreConfig.getWriteDelaySeconds() > 0) {
final ExecutionService executionService = nodeEngine.getExecutionService();
executionService.register(mapStoreScheduledExecutorName, 1, 100000, ExecutorType.CACHED);
ScheduledExecutorService scheduledExecutor = executionService
.getScheduledExecutor(mapStoreScheduledExecutorName);
mapStoreScheduler = EntryTaskSchedulerFactory.newScheduler(scheduledExecutor,