@Override public boolean isClosed() { return isClosed.get() || !hazelcastInstance.getLifecycleService().isRunning(); }
@Override public boolean isClosed() { return isClosed.get() || !hazelcastInstance.getLifecycleService().isRunning(); }
/** * @return {@code true} if good, exception otherwise */ @GetMapping("/k8s") public String k8s() { LOGGER.info("k8s()"); Boolean running = this.hazelcastInstance.getLifecycleService().isRunning(); if (running) { return running.toString(); } else { throw new RuntimeException("Running==" + running); } }
@Override public boolean isAvailable() { return isAvailable && hazelcastInstance.getLifecycleService().isRunning(); }
protected HazelcastClientInstanceImpl getClient() { final HazelcastClientInstanceImpl c = client; if (c == null || !c.getLifecycleService().isRunning()) { throw new HazelcastClientNotActiveException("Client is not active."); } return c; }
protected HazelcastClientInstanceImpl getClient() { final HazelcastClientInstanceImpl c = client; if (c == null || !c.getLifecycleService().isRunning()) { throw new HazelcastClientNotActiveException("Client is not active."); } return c; }
@Override public void onFailure(Throwable t) { if (client.getLifecycleService().isRunning()) { logger.warning("Error while fetching cluster partition table!", t); } } }
@Override public void onFailure(Throwable t) { if (client.getLifecycleService().isRunning()) { logger.warning("Error while fetching cluster partition table!", t); } } }
public boolean isActive() { return getHazelcastInstance().getLifecycleService().isRunning(); } }
public boolean isActive() { return getHazelcastInstance().getLifecycleService().isRunning(); } }
public static void main(String[] args) { final HazelcastInstance instance1 = Hazelcast.newHazelcastInstance(); final HazelcastInstance instance2 = Hazelcast.newHazelcastInstance(); System.out.println("Instance-1 members: " + instance1.getCluster().getMembers()); System.out.println("Instance-2 members: " + instance2.getCluster().getMembers()); // shutdown cluster instance2.getCluster().shutdown(); System.out.println("Instance-1: Is running?: " + instance1.getLifecycleService().isRunning()); System.out.println("Instance-2: Is running?: " + instance2.getLifecycleService().isRunning()); } }
public boolean isRunning() { return isEnabled() && hz.getLifecycleService().isRunning(); }
@Override public void stop() { if (instance != null && instance.getLifecycleService().isRunning()) { instance.getLifecycleService().shutdown(); } }
@Override public void stop() { if (instance != null && instance.getLifecycleService().isRunning()) { instance.getLifecycleService().shutdown(); } }
public static void initializeStatusHolder(String executionPlanName, int tenantId, int parallel) { String stormTopologyName = StormTopologyManager.getTopologyName(executionPlanName, tenantId); HazelcastInstance hazelcastInstance = EventProcessorValueHolder.getHazelcastInstance(); if (hazelcastInstance != null && hazelcastInstance.getLifecycleService().isRunning()) { IMap<String, ExecutionPlanStatusHolder> executionPlanStatusHolderIMap = hazelcastInstance.getMap(DistributedModeConstants.STORM_STATUS_MAP); ExecutionPlanStatusHolder executionPlanStatusHolder = new ExecutionPlanStatusHolder(parallel); executionPlanStatusHolderIMap.put(stormTopologyName, executionPlanStatusHolder); } else { log.error("Couldn't initialize status info object for execution plan: " + executionPlanName + ", for tenant-ID: " + tenantId + " as the hazelcast instance is not active or not available."); } } }
public void start(final Settings settings, final Properties properties) throws CacheException { log.info("Starting up " + getClass().getSimpleName()); if (instance == null || !instance.getLifecycleService().isRunning()) { instanceLoader = HazelcastInstanceFactory.createInstanceLoader(properties); instance = instanceLoader.loadInstance(); } cleanupService = new CleanupService(instance.getName()); }
/** * Get the number of members in the cluster. * * @return The number of members in the cluster or <code>-1</code> if the information is not available */ public static int getNumMembers() { if (!getHazelcastInstance().getLifecycleService().isRunning()) { return -1; } else { return getHazelcastInstance().getCluster().getMembers().size(); } }
/** * Get the number of members in the cluster. * * @return The number of members in the cluster or <code>-1</code> if the information is not available */ public static int getNumMembers() { if (!getHazelcastInstance().getLifecycleService().isRunning()) { return -1; } else { return getHazelcastInstance().getCluster().getMembers().size(); } }
@Override public void onDisconnectFromCluster() { disconnectedFromCluster = true; if (reconnectMode == OFF) { shutdownWithExternalThread(); return; } if (clientContext.getLifecycleService().isRunning()) { try { connector.connectToClusterAsync(); } catch (RejectedExecutionException r) { shutdownWithExternalThread(); } } }
@Override public void run() { Address endpoint = connection.getEndPoint(); // it may be possible that while waiting on executor queue, the client got connected (another connection), // then we do not need to do anything for cluster disconnect. if (endpoint == null || !endpoint.equals(ownerConnectionAddress)) { return; } setOwnerConnectionAddress(null); connectionStrategy.onDisconnectFromCluster(); if (client.getLifecycleService().isRunning()) { fireConnectionEvent(LifecycleEvent.LifecycleState.CLIENT_DISCONNECTED); } } });