Example usage for org.apache.cassandra.gms ApplicationState RACK

List of usage examples for org.apache.cassandra.gms ApplicationState RACK

Introduction

In this page you can find the example usage for org.apache.cassandra.gms ApplicationState RACK.

Prototype

ApplicationState RACK

To view the source code for org.apache.cassandra.gms ApplicationState RACK.

Click Source Link

Usage

From source file:brooklyn.entity.nosql.cassandra.customsnitch.MultiCloudSnitch.java

License:Apache License

public String getRack(InetAddress endpoint) {
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return rack;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.RACK) == null)
        return DEFAULT_RACK;
    return state.getApplicationState(ApplicationState.RACK).value;
}