Package org.apache.cassandra.gms

Examples of org.apache.cassandra.gms.EndPointState


     * @param endpoint the endpoint to process
     * @return string of rack
     */
    public String getRack(InetAddress endpoint)
    {
        EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
        if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null)
        {
            if (psnitch == null)
                throw new RuntimeException("Could not retrieve rack for " + endpoint + " from gossip and PFS compatibility is disabled");
            else
                return psnitch.getRack(endpoint);
        }
        return epState.getApplicationState(ApplicationState.RACK).value;
    }
View Full Code Here


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

            List<String> rpc_endpoints = new ArrayList<String>();
            List<EndpointDetails> epDetails = new ArrayList<EndpointDetails>();

            for (InetAddress endpoint : entry.getValue())
            {
                EndpointState eps = Gossiper.instance.getEndpointStateForEndpoint(endpoint);
                EndpointDetails details = new EndpointDetails();

                if (endpoint.equals(FBUtilities.getBroadcastAddress()))
                    details.host = DatabaseDescriptor.getRpcAddress().getHostAddress();
                else if (eps.getApplicationState(ApplicationState.RPC_ADDRESS) == null)
                    details.host = endpoint.getHostAddress();
                else
                    details.host = eps.getApplicationState(ApplicationState.RPC_ADDRESS).value;

                details.datacenter = DatabaseDescriptor.getEndpointSnitch().getDatacenter(endpoint);

                endpoints.add(details.host);
                rpc_endpoints.add(StorageService.instance.getRpcaddress(endpoint));
View Full Code Here

TOP

Related Classes of org.apache.cassandra.gms.EndPointState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.