Search in sources :

Example 1 with WanReplicationService

use of com.hazelcast.wan.impl.WanReplicationService in project hazelcast by hazelcast.

the class TimedMemberStateFactory method createMemState.

private void createMemState(MemberStateImpl memberState, Collection<StatisticsAwareService> services) {
    Config config = instance.getConfig();
    for (StatisticsAwareService service : services) {
        if (service instanceof MapService) {
            handleMap(memberState, ((MapService) service).getStats());
        } else if (service instanceof MultiMapService) {
            handleMultiMap(memberState, ((MultiMapService) service).getStats());
        } else if (service instanceof QueueService) {
            handleQueue(memberState, ((QueueService) service).getStats());
        } else if (service instanceof TopicService) {
            handleTopic(memberState, ((TopicService) service).getStats());
        } else if (service instanceof ReliableTopicService) {
            handleReliableTopic(memberState, ((ReliableTopicService) service).getStats());
        } else if (service instanceof DistributedExecutorService) {
            handleExecutorService(memberState, config, ((DistributedExecutorService) service).getStats());
        } else if (service instanceof DistributedScheduledExecutorService) {
            handleScheduledExecutorService(memberState, config, ((DistributedScheduledExecutorService) service).getStats());
        } else if (service instanceof DistributedDurableExecutorService) {
            handleDurableExecutorService(memberState, config, ((DistributedDurableExecutorService) service).getStats());
        } else if (service instanceof ReplicatedMapService) {
            handleReplicatedMap(memberState, config, ((ReplicatedMapService) service).getStats());
        } else if (service instanceof PNCounterService) {
            handlePNCounter(memberState, config, ((PNCounterService) service).getStats());
        } else if (service instanceof FlakeIdGeneratorService) {
            handleFlakeIdGenerator(memberState, config, ((FlakeIdGeneratorService) service).getStats());
        } else if (service instanceof CacheService) {
            handleCache(memberState, (CacheService) service);
        }
    }
    WanReplicationService wanReplicationService = instance.node.nodeEngine.getWanReplicationService();
    Map<String, LocalWanStats> wanStats = wanReplicationService.getStats();
    if (wanStats != null) {
        handleWan(memberState, wanStats);
    }
}
Also used : DistributedDurableExecutorService(com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService) StatisticsAwareService(com.hazelcast.internal.services.StatisticsAwareService) SocketInterceptorConfig(com.hazelcast.config.SocketInterceptorConfig) ConfigAccessor.getActiveMemberNetworkConfig(com.hazelcast.config.ConfigAccessor.getActiveMemberNetworkConfig) ManagementCenterConfig(com.hazelcast.config.ManagementCenterConfig) CacheConfig(com.hazelcast.config.CacheConfig) SSLConfig(com.hazelcast.config.SSLConfig) Config(com.hazelcast.config.Config) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) QueueService(com.hazelcast.collection.impl.queue.QueueService) WanReplicationService(com.hazelcast.wan.impl.WanReplicationService) FlakeIdGeneratorService(com.hazelcast.flakeidgen.impl.FlakeIdGeneratorService) TopicService(com.hazelcast.topic.impl.TopicService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) DistributedScheduledExecutorService(com.hazelcast.scheduledexecutor.impl.DistributedScheduledExecutorService) ReliableTopicService(com.hazelcast.topic.impl.reliable.ReliableTopicService) LocalWanStats(com.hazelcast.internal.monitor.LocalWanStats) DistributedExecutorService(com.hazelcast.executor.impl.DistributedExecutorService) MultiMapService(com.hazelcast.multimap.impl.MultiMapService) ReplicatedMapService(com.hazelcast.replicatedmap.impl.ReplicatedMapService) MapService(com.hazelcast.map.impl.MapService) PNCounterService(com.hazelcast.internal.crdt.pncounter.PNCounterService) CacheService(com.hazelcast.cache.impl.CacheService)

Example 2 with WanReplicationService

use of com.hazelcast.wan.impl.WanReplicationService in project hazelcast by hazelcast.

the class WanCheckConsistencyOperation method run.

@Override
public void run() throws Exception {
    NodeEngine nodeEngine = getNodeEngine();
    WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService();
    wanReplicationService.consistencyCheck(schemeName, publisherName, mapName);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) WanReplicationService(com.hazelcast.wan.impl.WanReplicationService)

Example 3 with WanReplicationService

use of com.hazelcast.wan.impl.WanReplicationService in project hazelcast by hazelcast.

the class ClearWanQueuesOperation method run.

@Override
public void run() throws Exception {
    NodeEngine nodeEngine = getNodeEngine();
    WanReplicationService wanReplicationService = nodeEngine.getWanReplicationService();
    wanReplicationService.removeWanEvents(schemeName, publisherName);
}
Also used : NodeEngine(com.hazelcast.spi.impl.NodeEngine) WanReplicationService(com.hazelcast.wan.impl.WanReplicationService)

Example 4 with WanReplicationService

use of com.hazelcast.wan.impl.WanReplicationService in project hazelcast by hazelcast.

the class AbstractCacheService method deleteCache.

@Override
public void deleteCache(String cacheNameWithPrefix, UUID 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);
}
Also used : WanReplicationService(com.hazelcast.wan.impl.WanReplicationService) CacheConfig(com.hazelcast.config.CacheConfig) ConfigValidator.checkCacheConfig(com.hazelcast.internal.config.ConfigValidator.checkCacheConfig) PreJoinCacheConfig.asCacheConfig(com.hazelcast.cache.impl.PreJoinCacheConfig.asCacheConfig)

Example 5 with WanReplicationService

use of com.hazelcast.wan.impl.WanReplicationService in project hazelcast by hazelcast.

the class HttpPostCommandProcessor method handleWanConsistencyCheck.

/**
 * Initiates a WAN consistency check for a single map and the WAN replication
 * name and publisher ID defined by the command parameters.
 *
 * @param cmd the HTTP command
 */
@SuppressWarnings("checkstyle:magicnumber")
private void handleWanConsistencyCheck(HttpPostCommand cmd) throws Throwable {
    String[] params = decodeParamsAndAuthenticate(cmd, 5);
    String wanReplicationName = params[2];
    String publisherId = params[3];
    String mapName = params[4];
    WanReplicationService service = getNode().getNodeEngine().getWanReplicationService();
    UUID uuid = service.consistencyCheck(wanReplicationName, publisherId, mapName);
    prepareResponse(cmd, response(SUCCESS, "message", "Consistency check initiated", "uuid", uuid.toString()));
}
Also used : WanReplicationService(com.hazelcast.wan.impl.WanReplicationService) UUID(java.util.UUID)

Aggregations

WanReplicationService (com.hazelcast.wan.impl.WanReplicationService)10 NodeEngine (com.hazelcast.spi.impl.NodeEngine)3 CacheConfig (com.hazelcast.config.CacheConfig)2 Config (com.hazelcast.config.Config)2 CacheService (com.hazelcast.cache.impl.CacheService)1 PreJoinCacheConfig.asCacheConfig (com.hazelcast.cache.impl.PreJoinCacheConfig.asCacheConfig)1 QueueService (com.hazelcast.collection.impl.queue.QueueService)1 ConfigAccessor.getActiveMemberNetworkConfig (com.hazelcast.config.ConfigAccessor.getActiveMemberNetworkConfig)1 EventJournalConfig (com.hazelcast.config.EventJournalConfig)1 IndexConfig (com.hazelcast.config.IndexConfig)1 InvalidConfigurationException (com.hazelcast.config.InvalidConfigurationException)1 ManagementCenterConfig (com.hazelcast.config.ManagementCenterConfig)1 MapConfig (com.hazelcast.config.MapConfig)1 SSLConfig (com.hazelcast.config.SSLConfig)1 SocketInterceptorConfig (com.hazelcast.config.SocketInterceptorConfig)1 WanConsumerConfig (com.hazelcast.config.WanConsumerConfig)1 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)1 WanReplicationRef (com.hazelcast.config.WanReplicationRef)1 WanSyncConfig (com.hazelcast.config.WanSyncConfig)1 DistributedDurableExecutorService (com.hazelcast.durableexecutor.impl.DistributedDurableExecutorService)1