Skip to content

Commit

Permalink
make CHECK_PERIOD_IN_MS field, static
Browse files Browse the repository at this point in the history
  • Loading branch information
mebigfatguy committed May 5, 2013
1 parent b460b56 commit 0f4ce2f
Showing 1 changed file with 9 additions and 9 deletions.
Expand Up @@ -60,6 +60,14 @@ public class YamlFileNetworkTopologySnitch
/** Logger. */ /** Logger. */
private static final Logger logger = LoggerFactory private static final Logger logger = LoggerFactory
.getLogger(YamlFileNetworkTopologySnitch.class); .getLogger(YamlFileNetworkTopologySnitch.class);

/**
* How often to check the topology configuration file, in milliseconds; defaults to one minute.
*/
private static final int CHECK_PERIOD_IN_MS = 60 * 1000;

/** Default name for the topology configuration file. */
private static final String DEFAULT_TOPOLOGY_CONFIG_FILENAME = "cassandra-topology.yaml";


/** Node data map, keyed by broadcast address. */ /** Node data map, keyed by broadcast address. */
private volatile Map<InetAddress, NodeData> nodeDataMap; private volatile Map<InetAddress, NodeData> nodeDataMap;
Expand All @@ -70,17 +78,9 @@ public class YamlFileNetworkTopologySnitch
/** Node data to fall back to when there is no match. */ /** Node data to fall back to when there is no match. */
private volatile NodeData defaultNodeData; private volatile NodeData defaultNodeData;


/** Default name for the topology configuration file. */
private static final String DEFAULT_TOPOLOGY_CONFIG_FILENAME = "cassandra-topology.yaml";

/** Name of the topology configuration file. */ /** Name of the topology configuration file. */
private final String topologyConfigFilename; private final String topologyConfigFilename;


/**
* How often to check the topology configuration file, in milliseconds; defaults to one minute.
*/
private final int checkPeriodInMs = 60 * 1000;

/** True if the gossiper has been initialized. */ /** True if the gossiper has been initialized. */
private volatile boolean gossiperInitialized = false; private volatile boolean gossiperInitialized = false;


Expand Down Expand Up @@ -127,7 +127,7 @@ protected void runMayThrow() throws ConfigurationException
} }
}; };
ResourceWatcher.watch(topologyConfigFilename, runnable, ResourceWatcher.watch(topologyConfigFilename, runnable,
checkPeriodInMs); CHECK_PERIOD_IN_MS);
} }
catch (final ConfigurationException e) catch (final ConfigurationException e)
{ {
Expand Down

0 comments on commit 0f4ce2f

Please sign in to comment.