Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/cassandra/trunk@1022666 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jbellis committed Oct 14, 2010
1 parent 7aac793 commit 1e233d7
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/java/org/apache/cassandra/locator/PropertyFileSnitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public class PropertyFileSnitch extends AbstractNetworkTopologySnitch
*/
private static Logger logger_ = LoggerFactory.getLogger(PropertyFileSnitch.class);

public PropertyFileSnitch() throws ConfigurationException {
public PropertyFileSnitch() throws ConfigurationException
{
reloadConfiguration();
Runnable runnable = new WrappedRunnable()
{
Expand All @@ -68,12 +69,12 @@ protected void runMayThrow() throws ConfigurationException

/**
* Get the raw information about an end point
*
*
* @param endpoint endpoint to process
*
* @return a array of string with the first index being the data center and the second being the rack
*/
public String[] getEndpointInfo(InetAddress endpoint) {
public String[] getEndpointInfo(InetAddress endpoint)
{
String key = endpoint.getHostAddress();
String value = hostProperties.getProperty(key);
if (value == null)
Expand All @@ -85,29 +86,30 @@ public String[] getEndpointInfo(InetAddress endpoint) {
if (st.countTokens() < 2)
{
logger_.error("Value for " + key + " is invalid: " + value);
return new String [] {"default", "default"};
return new String[] { "default", "default" };
}
return new String[] {st.nextToken(), st.nextToken()};
return new String[] { st.nextToken(), st.nextToken() };
}

/**
* Return the data center for which an endpoint resides in
*
*
* @param endpoint the endpoint to process
* @return string of data center
*/
public String getDatacenter(InetAddress endpoint) {
public String getDatacenter(InetAddress endpoint)
{
return getEndpointInfo(endpoint)[0];
}

/**
* Return the rack for which an endpoint resides in
*
*
* @param endpoint the endpoint to process
*
* @return string of rack
*/
public String getRack(InetAddress endpoint) {
public String getRack(InetAddress endpoint)
{
return getEndpointInfo(endpoint)[1];
}

Expand Down

0 comments on commit 1e233d7

Please sign in to comment.