@Override protected GlobalConfigurationBuilder configure(int nodeId) { GlobalConfigurationBuilder builder = GlobalConfigurationBuilder.defaultClusteredBuilder(); builder.globalState().enable().persistentLocation(PERSISTENT_FOLDER + File.separator + nodeId) .temporaryLocation(TEMP_PERSISTENT_FOLDER + File.separator + nodeId) .sharedPersistentLocation(SHARED_PERSISTENT_FOLDER + File.separator + nodeId); CounterManagerConfigurationBuilder counterBuilder = builder.addModule(CounterManagerConfigurationBuilder.class); defaultCounters.forEach(counterDefinition -> counterDefinition.define(counterBuilder)); return builder; }
private static GlobalConfigurationBuilder defaultGlobalConfigurationBuilder(boolean globalStateEnabled) { GlobalConfigurationBuilder builder = GlobalConfigurationBuilder.defaultClusteredBuilder(); builder.globalState().enabled(globalStateEnabled).persistentLocation(PERSISTENT_FOLDER) .temporaryLocation(TEMP_PERSISTENT_FOLDER) .sharedPersistentLocation(SHARED_PERSISTENT_FOLDER); return builder; }
@Override protected void createCacheManagers() { for (int i = 0; i < nodeCount(); i++) { char id = 'A'; id += i; GlobalConfigurationBuilder builder = new GlobalConfigurationBuilder().clusteredDefault(); builder.globalState().enable() .persistentLocation(PERSISTENT_LOCATION + File.separator + id) .temporaryLocation(TMP_LOCATION) .sharedPersistentLocation(SHARED_LOCATION); EmbeddedCacheManager cm = createClusteredCacheManager(builder, hotRodCacheConfiguration()); cacheManagers.add(cm); } waitForClusterToForm(CounterModuleLifecycle.COUNTER_CACHE_NAME); }
statePersistenceBuilder.sharedPersistentLocation(sharedPersistentLocation); String temporaryLocation = pathManager.getValue().resolveRelativePathEntry(statePersistence.getTemporaryPath(), statePersistence.getTemporaryRelativeTo()); statePersistenceBuilder.temporaryLocation(temporaryLocation); statePersistenceBuilder.configurationStorage(statePersistence.getConfigurationStorage());