Skip to content

Commit

Permalink
avoid trying to watch cassandra-topology.properties when loaded from jar
Browse files Browse the repository at this point in the history
patch by Mck SembWever; reviewed by jbellis for CASSANDRA-3138

git-svn-id: https://svn.apache.org/repos/asf/cassandra/branches/cassandra-0.8@1165405 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jbellis committed Sep 5, 2011
1 parent 2d53438 commit ba8f601
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.8.6
* avoid trying to watch cassandra-topology.properties when loaded from jar
(CASSANDRA-3138)


0.8.5
* fix NPE when encryption_options is unspecified (CASSANDRA-3007)
* include column name in validation failure exceptions (CASSANDRA-2849)
Expand Down
20 changes: 14 additions & 6 deletions src/java/org/apache/cassandra/locator/PropertyFileSnitch.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,22 @@ public class PropertyFileSnitch extends AbstractNetworkTopologySnitch
public PropertyFileSnitch() throws ConfigurationException
{
reloadConfiguration();
Runnable runnable = new WrappedRunnable()
try
{
protected void runMayThrow() throws ConfigurationException
FBUtilities.resourceToFile(RACK_PROPERTY_FILENAME);
Runnable runnable = new WrappedRunnable()
{
reloadConfiguration();
}
};
ResourceWatcher.watch(RACK_PROPERTY_FILENAME, runnable, 60 * 1000);
protected void runMayThrow() throws ConfigurationException
{
reloadConfiguration();
}
};
ResourceWatcher.watch(RACK_PROPERTY_FILENAME, runnable, 60 * 1000);
}
catch (ConfigurationException ex)
{
logger.debug(RACK_PROPERTY_FILENAME + " found, but does not look like a plain file. Will not watch it for changes");
}
}

/**
Expand Down

0 comments on commit ba8f601

Please sign in to comment.