private double getSeverity(InetAddress endpoint) { EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (state == null) return 0.0; VersionedValue event = state.getApplicationState(ApplicationState.SEVERITY); if (event == null) return 0.0; return Double.parseDouble(event.value); }
private boolean isStatus(InetAddress endpoint, String status) { EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); return state != null && state.getStatus().equals(status); }
public String getEndpointState(String address) throws UnknownHostException { StringBuilder sb = new StringBuilder(); EndpointState endpointState = Gossiper.instance.getEndpointStateForEndpoint(InetAddress.getByName(address)); appendEndpointState(sb, endpointState); return sb.toString(); }
private boolean isStatus(InetAddress endpoint, String status) { EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); return state != null && state.getStatus().equals(status); }
@Nullable public UUID getSchemaVersion(InetAddress ep) { EndpointState state = getEndpointStateForEndpoint(ep); return state != null ? state.getSchemaVersion() : null; }
@Nullable public UUID getSchemaVersion(InetAddress ep) { EndpointState state = getEndpointStateForEndpoint(ep); return state != null ? state.getSchemaVersion() : null; }
public String getEndpointState(String address) throws UnknownHostException { StringBuilder sb = new StringBuilder(); EndpointState endpointState = Gossiper.instance.getEndpointStateForEndpoint(InetAddress.getByName(address)); appendEndpointState(sb, endpointState); return sb.toString(); }
@Nullable public UUID getSchemaVersion(InetAddress ep) { EndpointState state = getEndpointStateForEndpoint(ep); return state != null ? state.getSchemaVersion() : null; }
private double getSeverity(InetAddress endpoint) { EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (state == null) return 0.0; VersionedValue event = state.getApplicationState(ApplicationState.SEVERITY); if (event == null) return 0.0; return Double.parseDouble(event.value); }
public String getEndpointState(String address) throws UnknownHostException { StringBuilder sb = new StringBuilder(); EndpointState endpointState = Gossiper.instance.getEndpointStateForEndpoint(InetAddress.getByName(address)); appendEndpointState(sb, endpointState); return sb.toString(); }
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 void setSearchEnabled(boolean ready, boolean forcePublishX1) throws IOException { if (ready && !isNormal(Gossiper.instance.getEndpointStateForEndpoint(this.localAddress))) { throw new IOException("Cassandra not ready for search"); } if (searchEnabled.getAndSet(ready) != ready || forcePublishX1) { logger.info("searchEnabled set to [{}]", ready); publishX1(forcePublishX1); } }
public void onChange(InetAddress endpoint, ApplicationState state, VersionedValue value) { if (preferLocal && state == ApplicationState.INTERNAL_IP && !Gossiper.instance.isDeadState(Gossiper.instance.getEndpointStateForEndpoint(endpoint))) reconnect(endpoint, value); }
/** * determine which endpoint started up earlier */ public int compareEndpointStartup(InetAddress addr1, InetAddress addr2) { EndpointState ep1 = getEndpointStateForEndpoint(addr1); EndpointState ep2 = getEndpointStateForEndpoint(addr2); assert ep1 != null && ep2 != null; return ep1.getHeartBeatState().getGeneration() - ep2.getHeartBeatState().getGeneration(); }
public boolean isAlive(InetAddress endpoint) { EndpointState epState = getEndpointStateForEndpoint(endpoint); if (epState == null) return false; return epState.isAlive() && !isDeadState(epState); }
public void onChange(InetAddress endpoint, ApplicationState state, VersionedValue value) { if (preferLocal && !Gossiper.instance.isDeadState(Gossiper.instance.getEndpointStateForEndpoint(endpoint)) && state == ApplicationState.INTERNAL_IP) reconnect(endpoint, value); }
public void onChange(InetAddress endpoint, ApplicationState state, VersionedValue value) { if (preferLocal && state == ApplicationState.INTERNAL_IP && !Gossiper.instance.isDeadState(Gossiper.instance.getEndpointStateForEndpoint(endpoint))) reconnect(endpoint, value); }
/** * determine which endpoint started up earlier */ public int compareEndpointStartup(InetAddress addr1, InetAddress addr2) { EndpointState ep1 = getEndpointStateForEndpoint(addr1); EndpointState ep2 = getEndpointStateForEndpoint(addr2); assert ep1 != null && ep2 != null; return ep1.getHeartBeatState().getGeneration() - ep2.getHeartBeatState().getGeneration(); }
public boolean isAlive(InetAddress endpoint) { EndpointState epState = getEndpointStateForEndpoint(endpoint); if (epState == null) return false; return epState.isAlive() && !isDeadState(epState); }
@Override public void onDead(InetAddress endpoint, EndpointState epState) { if (isMember(endpoint)) { logger.debug("onDead Endpoint={} ApplicationState={} isAlive={} => update node + disconnecting", endpoint, epState, epState.isAlive()); if (this.metaDataVersionAckListener.get() != null) { notifyMetaDataVersionAckListener(Gossiper.instance.getEndpointStateForEndpoint(endpoint)); } updateNode(endpoint, epState, DiscoveryNodeStatus.DEAD); } }