@Override public void stateChanged(LifecycleEvent event) { logger.info("stateChanged; event: {}", event); if (LifecycleState.STARTED == event.getState()) { xtxCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_TRANSACTION); xddCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_DOCUMENT); keyCache = nodeEngine.getHazelcastInstance().getMap(CN_XDM_KEY); //readCatalog(catalog); // too early //checkPopulation(nodeEngine.getClusterService().getSize()); } else if (LifecycleState.SHUTTING_DOWN == event.getState()) { xtxCache.flush(); xddCache.flush(); logger.info("stateChanged; Maps were flushed"); } }
@Override public void stateChanged(LifecycleEvent event) { switch (event.getState()) { case CLIENT_CONNECTION_OPENED: logger.info("Connected to DVE cluster."); break; case CLIENT_CONNECTION_LOST: logger.info("Disconnected from DVE cluster."); break; case SHUTDOWN: cleanup(); if (autoReconnect) { reconnect(); } break; default: // logger.debug(event); } }
public void stateChanged(LifecycleEvent event) { if (event.getState().equals(LifecycleState.SHUTDOWN)) { leaveCluster(); } else if (event.getState().equals(LifecycleState.STARTED)) { joinCluster(); } }
public void fireLifecycleEvent(final LifecycleState lifecycleState) { callAsync(new Callable<Object>() { public Object call() throws Exception { fireLifecycleEvent(new LifecycleEvent(lifecycleState)); return null; } }); }
/** * On {@link com.hazelcast.core.LifecycleEvent.LifecycleState} MERGED event all the topic listeners for the local node is added back. Since the data structures except for * IMaps are not merged after a split brain scenario within Hazelcast (data structures from MERGED nodes are * discarded) * @param lifecycleEvent {@link LifecycleEvent} */ @Override public void stateChanged(LifecycleEvent lifecycleEvent) { try { log.info("Hazelcast instance lifecycle changed state to " + lifecycleEvent.getState()); if (lifecycleEvent.getState() == LifecycleEvent.LifecycleState.MERGED) { log.info("Hazelcast cluster merge detected after a split brain. Updating unmerged data structures"); AndesContext.getInstance().getClusterNotificationListenerManager().reInitializeListener(); AndesSubscriptionManager andesSubscriptionManager = AndesContext.getInstance() .getAndesSubscriptionManager(); if(null != andesSubscriptionManager) { andesSubscriptionManager.updateSubscriptionsAfterClusterMerge(); } else { log.error("Andes Subscription Manager is not set. Local subscriptions are not synced with the " + "main cluster"); } // Notify that network partition has occurred. networkPartitionDetector.networkPartitionMerged(); } else if (lifecycleEvent.getState() == LifecycleState.SHUTDOWN){ networkPartitionDetector.clusterOutageOccurred(); } } catch (Throwable e) { log.error("Error occurred while handling Hazelcast state change event " + lifecycleEvent.getState(), e); } }
@Override public void stateChanged(LifecycleEvent event) { if (event.getState().equals(LifecycleState.SHUTDOWN)) { sessionService.setFailedConnection(true); } }
private void onHazelcastStateChange(final LifecycleEvent event) { log.debug("Hazelcast lifecycle event: {}.", event); if (event.getState() == LifecycleEvent.LifecycleState.SHUTTING_DOWN) { cleanUp(); } }
public void fireLifecycleEvent(LifecycleState lifecycleState) { fireLifecycleEvent(new LifecycleEvent(lifecycleState)); }
public void fireLifecycleEvent(LifecycleEvent lifecycleEvent) { logger.log(Level.INFO, node.getThisAddress() + " is " + lifecycleEvent.getState()); for (LifecycleListener lifecycleListener : lsLifecycleListeners) { lifecycleListener.stateChanged(lifecycleEvent); } }
public void fireLifecycleEvent(final LifecycleEvent event) { logger.log(Level.INFO, "HazelcastClient is " + event.getState()); for (LifecycleListener lifecycleListener : lsLifecycleListeners) { lifecycleListener.stateChanged(event); } }
@Override public void stateChanged(LifecycleEvent event) { log.info("Hazelcast has new state: " + event); }
public void fireLifecycleEvent(LifecycleEvent lifecycleEvent) { getLogger().log(Level.INFO, factory.node.getThisAddress() + " is " + lifecycleEvent.getState()); for (LifecycleListener lifecycleListener : lsLifecycleListeners) { lifecycleListener.stateChanged(lifecycleEvent); } }