@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationService.consistencyCheck(schemeName, publisherName, mapName); } }
@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationService.clearQueues(schemeName, publisherName); } }
MapReplicationSupportingService(MapServiceContext mapServiceContext) { this.mapServiceContext = mapServiceContext; this.nodeEngine = mapServiceContext.getNodeEngine(); this.wanEventTypeCounters = nodeEngine.getWanReplicationService() .getReceivedEventCounters(MapService.SERVICE_NAME); }
@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationService.consistencyCheck(schemeName, publisherName, mapName); } }
@Override public void run() throws Exception { WanReplicationService wanReplicationService = getNodeEngine().getWanReplicationService(); wanReplicationService.addWanReplicationConfig(wanReplicationConfig); }
MapReplicationSupportingService(MapServiceContext mapServiceContext) { this.mapServiceContext = mapServiceContext; this.nodeEngine = mapServiceContext.getNodeEngine(); this.wanEventTypeCounters = nodeEngine.getWanReplicationService() .getReceivedEventCounters(MapService.SERVICE_NAME); }
@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationService.clearQueues(schemeName, publisherName); } }
@Override public void run() throws Exception { getNodeEngine().getWanReplicationService() .addWanReplicationConfigLocally(wanReplicationConfig); getLogger().info("Appended WAN config with name " + wanReplicationConfig.getName()); }
@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); switch (state) { case REPLICATING: wanReplicationService.resume(schemeName, publisherName); break; case PAUSED: wanReplicationService.pause(schemeName, publisherName); break; case STOPPED: wanReplicationService.stop(schemeName, publisherName); break; default: break; } } }
@Override public void run() throws Exception { NodeEngine nodeEngine = getNodeEngine(); WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); switch (state) { case REPLICATING: wanReplicationService.resume(schemeName, publisherName); break; case PAUSED: wanReplicationService.pause(schemeName, publisherName); break; case STOPPED: wanReplicationService.stop(schemeName, publisherName); break; default: break; } } }
@Override public void destroyMap(String mapName) { // on LiteMembers we don't have a MapContainer, but we may have a Near Cache and listeners mapNearCacheManager.destroyNearCache(mapName); nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME, mapName); MapContainer mapContainer = mapContainers.get(mapName); if (mapContainer == null) { return; } nodeEngine.getWanReplicationService().removeWanEventCounters(MapService.SERVICE_NAME, mapName); mapContainer.getMapStoreContext().stop(); localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName()); destroyPartitionsAndMapContainer(mapContainer); }
@Override public void destroyMap(String mapName) { // on LiteMembers we don't have a MapContainer, but we may have a Near Cache and listeners mapNearCacheManager.destroyNearCache(mapName); nodeEngine.getEventService().deregisterAllListeners(SERVICE_NAME, mapName); MapContainer mapContainer = mapContainers.get(mapName); if (mapContainer == null) { return; } nodeEngine.getWanReplicationService().removeWanEventCounters(MapService.SERVICE_NAME, mapName); mapContainer.getMapStoreContext().stop(); localMapStatsProvider.destroyLocalMapStatsImpl(mapContainer.getName()); destroyPartitionsAndMapContainer(mapContainer); }
@Override public void deleteCache(String cacheNameWithPrefix, String callerUuid, boolean destroy) { CacheConfig config = deleteCacheConfig(cacheNameWithPrefix); if (config == null) { // Cache is already cleaned up return; } if (destroy) { cacheEventHandler.destroy(cacheNameWithPrefix, SOURCE_NOT_AVAILABLE); destroySegments(config); } else { closeSegments(cacheNameWithPrefix); } WanReplicationService wanService = nodeEngine.getWanReplicationService(); wanService.removeWanEventCounters(ICacheService.SERVICE_NAME, cacheNameWithPrefix); cacheContexts.remove(cacheNameWithPrefix); operationProviderCache.remove(cacheNameWithPrefix); deregisterAllListener(cacheNameWithPrefix); setStatisticsEnabled(config, cacheNameWithPrefix, false); setManagementEnabled(config, cacheNameWithPrefix, false); deleteCacheStat(cacheNameWithPrefix); deleteCacheResources(cacheNameWithPrefix); }
@Override public void deleteCache(String cacheNameWithPrefix, String callerUuid, boolean destroy) { CacheConfig config = deleteCacheConfig(cacheNameWithPrefix); if (config == null) { // Cache is already cleaned up return; } if (destroy) { cacheEventHandler.destroy(cacheNameWithPrefix, SOURCE_NOT_AVAILABLE); destroySegments(config); } else { closeSegments(cacheNameWithPrefix); } WanReplicationService wanService = nodeEngine.getWanReplicationService(); wanService.removeWanEventCounters(ICacheService.SERVICE_NAME, cacheNameWithPrefix); cacheContexts.remove(cacheNameWithPrefix); operationProviderCache.remove(cacheNameWithPrefix); deregisterAllListener(cacheNameWithPrefix); setStatisticsEnabled(config, cacheNameWithPrefix, false); setManagementEnabled(config, cacheNameWithPrefix, false); deleteCacheStat(cacheNameWithPrefix); deleteCacheResources(cacheNameWithPrefix); }
public void initWanReplication(NodeEngine nodeEngine) { WanReplicationRef wanReplicationRef = mapConfig.getWanReplicationRef(); if (wanReplicationRef == null) { return; } String wanReplicationRefName = wanReplicationRef.getName(); Config config = nodeEngine.getConfig(); if (!config.findMapMerkleTreeConfig(name).isEnabled() && hasPublisherWithMerkleTreeSync(config, wanReplicationRefName)) { throw new InvalidConfigurationException( "Map " + name + " has disabled merkle trees but the WAN replication scheme " + wanReplicationRefName + " has publishers that use merkle trees." + " Please enable merkle trees for the map."); } WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationPublisher = wanReplicationService.getWanReplicationPublisher(wanReplicationRefName); wanMergePolicy = mapServiceContext.getMergePolicyProvider().getMergePolicy(wanReplicationRef.getMergePolicy()); WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName); if (wanReplicationConfig != null) { WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig(); if (wanConsumerConfig != null) { persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData(); } } }
public void initWanReplication(NodeEngine nodeEngine) { WanReplicationRef wanReplicationRef = mapConfig.getWanReplicationRef(); if (wanReplicationRef == null) { return; } String wanReplicationRefName = wanReplicationRef.getName(); Config config = nodeEngine.getConfig(); if (!config.findMapMerkleTreeConfig(name).isEnabled() && hasPublisherWithMerkleTreeSync(config, wanReplicationRefName)) { throw new InvalidConfigurationException( "Map " + name + " has disabled merkle trees but the WAN replication scheme " + wanReplicationRefName + " has publishers that use merkle trees." + " Please enable merkle trees for the map."); } WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService(); wanReplicationPublisher = wanReplicationService.getWanReplicationPublisher(wanReplicationRefName); wanMergePolicy = mapServiceContext.getMergePolicyProvider().getMergePolicy(wanReplicationRef.getMergePolicy()); WanReplicationConfig wanReplicationConfig = config.getWanReplicationConfig(wanReplicationRefName); if (wanReplicationConfig != null) { WanConsumerConfig wanConsumerConfig = wanReplicationConfig.getWanConsumerConfig(); if (wanConsumerConfig != null) { persistWanReplicatedData = wanConsumerConfig.isPersistWanReplicatedData(); } } }