Search in sources :

Example 1 with EventType

use of com.ctrip.xpipe.redis.console.notifier.EventType in project x-pipe by ctripcorp.

the class DefaultClusterDeleteEventListener method update.

@Override
public void update(Object args, Observable observable) {
    EventType type = (EventType) args;
    if (!(observable instanceof ClusterDeleteEvent) || type != EventType.DELETE) {
        logger.info("[update] observable object not ShardDeleteEvent, skip. observable: {}, args: {}", observable.getClass().getName(), args.getClass().getName());
        return;
    }
    ClusterDeleteEvent clusterDeleteEvent = (ClusterDeleteEvent) observable;
    for (ShardEvent shardEvent : clusterDeleteEvent.getShardEvents()) {
        shardEvent.onEvent();
    }
}
Also used : ShardEvent(com.ctrip.xpipe.redis.console.notifier.shard.ShardEvent) EventType(com.ctrip.xpipe.redis.console.notifier.EventType)

Example 2 with EventType

use of com.ctrip.xpipe.redis.console.notifier.EventType in project x-pipe by ctripcorp.

the class ShardDeleteEventListener4Sentinel method update.

@Override
public void update(Object args, Observable observable) {
    EventType type = (EventType) args;
    if (!(observable instanceof ShardDeleteEvent) || type != EventType.DELETE) {
        logger.info("[update] observable object not ShardDeleteEvent, skip. observable: {}, args: {}", observable.getClass().getName(), args.getClass().getName());
        return;
    }
    ShardDeleteEvent shardDeleteEvent = (ShardDeleteEvent) observable;
    sentinelManager.removeShardSentinelMonitors(shardDeleteEvent);
}
Also used : EventType(com.ctrip.xpipe.redis.console.notifier.EventType)

Aggregations

EventType (com.ctrip.xpipe.redis.console.notifier.EventType)2 ShardEvent (com.ctrip.xpipe.redis.console.notifier.shard.ShardEvent)1