/** * Return the rack for which an endpoint resides in * * @param endpoint the endpoint to process * @return string of rack */ public String getRack(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return myRack; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null) { if (psnitch == null) { if (savedEndpoints == null) savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get("rack"); return DEFAULT_RACK; } else return psnitch.getRack(endpoint); } return epState.getApplicationState(ApplicationState.RACK).value; }
/** * Return the rack for which an endpoint resides in * * @param endpoint the endpoint to process * @return string of rack */ public String getRack(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return myRack; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null) { if (psnitch == null) { if (savedEndpoints == null) savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get("rack"); return DEFAULT_RACK; } else return psnitch.getRack(endpoint); } return epState.getApplicationState(ApplicationState.RACK).value; }
/** * Return the rack for which an endpoint resides in * * @param endpoint the endpoint to process * @return string of rack */ public String getRack(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return myRack; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null) { if (psnitch == null) { if (savedEndpoints == null) savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get("rack"); return DEFAULT_RACK; } else return psnitch.getRack(endpoint); } return epState.getApplicationState(ApplicationState.RACK).value; }
/** * Return the rack for which an endpoint resides in * * @param endpoint the endpoint to process * @return string of rack */ public String getRack(InetAddress endpoint) { if (endpoint.equals(FBUtilities.getBroadcastAddress())) return myRack; EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(endpoint); if (epState == null || epState.getApplicationState(ApplicationState.RACK) == null) { if (psnitch == null) { if (savedEndpoints == null) savedEndpoints = SystemKeyspace.loadDcRackInfo(); if (savedEndpoints.containsKey(endpoint)) return savedEndpoints.get(endpoint).get("rack"); return DEFAULT_RACK; } else return psnitch.getRack(endpoint); } return epState.getApplicationState(ApplicationState.RACK).value; }