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

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

Introduction

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

Prototype

ApplicationState DC

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

Click Source Link

Usage

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

License:Apache License

public String getDatacenter(InetAddress endpoint) {
    if (endpoint.equals(FBUtilities.getBroadcastAddress()))
        return datacenter;
    EndpointState state = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
    if (state == null || state.getApplicationState(ApplicationState.DC) == null)
        return DEFAULT_DC;
    return state.getApplicationState(ApplicationState.DC).value;
}