public int getUpEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (entry.getValue().isAlive()) count++; } return count; }
public int getUpEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (entry.getValue().isAlive()) count++; } return count; }
public int getDownEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (!entry.getValue().isAlive()) count++; } return count; }
public int getDownEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (!entry.getValue().isAlive()) count++; } return count; }
public int getDownEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (!entry.getValue().isAlive()) count++; } return count; }
public int getDownEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (!entry.getValue().isAlive()) count++; } return count; }
public int getUpEndpointCount() { int count = 0; for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (entry.getValue().isAlive()) count++; } return count; }
public Map<String, String> getSimpleStates() { Map<String, String> nodesStatus = new HashMap<String, String>(Gossiper.instance.endpointStateMap.size()); for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (entry.getValue().isAlive()) nodesStatus.put(entry.getKey().toString(), "UP"); else nodesStatus.put(entry.getKey().toString(), "DOWN"); } return nodesStatus; }
public Map<String, String> getSimpleStates() { Map<String, String> nodesStatus = new HashMap<String, String>(Gossiper.instance.endpointStateMap.size()); for (Map.Entry<InetAddress, EndpointState> entry : Gossiper.instance.endpointStateMap.entrySet()) { if (entry.getValue().isAlive()) nodesStatus.put(entry.getKey().toString(), "UP"); else nodesStatus.put(entry.getKey().toString(), "DOWN"); } return nodesStatus; }
public void onRestart(InetAddress endpoint, EndpointState state) { // If we have restarted before the node was even marked down, we need to reset the connection pool if (state.isAlive()) onDead(endpoint, state); }
public boolean isAlive(InetAddress ep) { if (ep.equals(FBUtilities.getBroadcastAddress())) return true; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep); // we could assert not-null, but having isAlive fail screws a node over so badly that // it's worth being defensive here so minor bugs don't cause disproportionate // badness. (See CASSANDRA-1463 for an example). if (epState == null) logger.error("Unknown endpoint: " + ep, new IllegalArgumentException("")); return epState != null && epState.isAlive(); }
public boolean isAlive(InetAddress ep) { if (ep.equals(FBUtilities.getBroadcastAddress())) return true; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep); // we could assert not-null, but having isAlive fail screws a node over so badly that // it's worth being defensive here so minor bugs don't cause disproportionate // badness. (See CASSANDRA-1463 for an example). if (epState == null) logger.error("Unknown endpoint: " + ep, new IllegalArgumentException("")); return epState != null && epState.isAlive(); }
public boolean isAlive(InetAddress ep) { if (ep.equals(FBUtilities.getBroadcastAddress())) return true; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep); // we could assert not-null, but having isAlive fail screws a node over so badly that // it's worth being defensive here so minor bugs don't cause disproportionate // badness. (See CASSANDRA-1463 for an example). if (epState == null) logger.error("Unknown endpoint: " + ep, new IllegalArgumentException("")); return epState != null && epState.isAlive(); }
public boolean isAlive(InetAddress ep) { if (ep.equals(FBUtilities.getBroadcastAddress())) return true; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(ep); // we could assert not-null, but having isAlive fail screws a node over so badly that // it's worth being defensive here so minor bugs don't cause disproportionate // badness. (See CASSANDRA-1463 for an example). if (epState == null) logger.error("unknown endpoint {}", ep); return epState != null && epState.isAlive(); }
public boolean isAlive(InetAddress endpoint) { EndpointState epState = getEndpointStateForEndpoint(endpoint); if (epState == null) return false; return epState.isAlive() && !isDeadState(epState); }
public boolean isAlive(InetAddress endpoint) { EndpointState epState = getEndpointStateForEndpoint(endpoint); if (epState == null) return false; return epState.isAlive() && !isDeadState(epState); }
/** * Warning: IEndpointStateChangeSubscriber.onXXXX should not block (on connection timeout or clusterState update) to avoid gossip issues. */ @Override public void onAlive(InetAddress endpoint, EndpointState epState) { if (isMember(endpoint)) { logger.debug("onAlive Endpoint={} ApplicationState={} isAlive={} => update node + connecting", endpoint, epState, epState.isAlive()); if (isNormal(epState)) updateNode(endpoint, epState, DiscoveryNodeStatus.ALIVE); } }
public void onRestart(InetAddress endpoint, EndpointState state) { // If we have restarted before the node was even marked down, we need to reset the connection pool if (state.isAlive()) onDead(endpoint, state); // Then, the node may have been upgraded and changed its messaging protocol version. If so, we // want to update that before we mark the node live again to avoid problems like CASSANDRA-11128. VersionedValue netVersion = state.getApplicationState(ApplicationState.NET_VERSION); if (netVersion != null) updateNetVersion(endpoint, netVersion); }
public void onRestart(InetAddress endpoint, EndpointState state) { // If we have restarted before the node was even marked down, we need to reset the connection pool if (state.isAlive()) onDead(endpoint, state); // Then, the node may have been upgraded and changed its messaging protocol version. If so, we // want to update that before we mark the node live again to avoid problems like CASSANDRA-11128. VersionedValue netVersion = state.getApplicationState(ApplicationState.NET_VERSION); if (netVersion != null) updateNetVersion(endpoint, netVersion); }
@Override public void onJoin(InetAddress endpoint, EndpointState epState) { if (isLocal(endpoint)) { if (logger.isTraceEnabled()) logger.trace("onJoin Endpoint={} ApplicationState={} isAlive={} status={}", endpoint, epState, epState.isAlive(), epState.getStatus() ); if (isNormal(epState)) updateNode(endpoint, epState, DiscoveryNodeStatus.ALIVE); } }