use of com.ctrip.xpipe.redis.console.notifier.cluster.ClusterEvent in project x-pipe by ctripcorp.
the class ClusterServiceImpl method deleteCluster.
@Override
public void deleteCluster(String clusterName) {
ClusterTbl proto = find(clusterName);
if (null == proto)
throw new BadRequestException("Cannot find cluster");
proto.setClusterLastModifiedTime(DataModifiedTimeGenerator.generateModifiedTime());
List<DcTbl> relatedDcs = dcService.findClusterRelatedDc(clusterName);
final ClusterTbl queryProto = proto;
// Call cluster delete event
ClusterEvent clusterEvent = clusterDeleteEventFactory.createClusterEvent(clusterName);
try {
clusterDao.deleteCluster(queryProto);
} catch (Exception e) {
throw new ServerException(e.getMessage());
}
clusterEvent.onEvent();
/**
* Notify meta server *
*/
notifier.notifyClusterDelete(clusterName, relatedDcs);
}
Aggregations