Skip to content
This repository has been archived by the owner on Nov 22, 2017. It is now read-only.

Commit

Permalink
Merge pull request #121 from cnauroth/cassandraDaemon
Browse files Browse the repository at this point in the history
Add stopServer method to CassandraUtils.java
  • Loading branch information
tjake committed Aug 17, 2011
2 parents 3e70885 + dfb7507 commit 60ce47c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/lucandra/CassandraUtils.java
Expand Up @@ -188,6 +188,8 @@ public class CassandraUtils

private static boolean cassandraStarted = false;

private static CassandraDaemon daemon = null;

public static String fakeToken = String.valueOf(System.nanoTime());

public static synchronized void setStartup()
Expand Down Expand Up @@ -250,7 +252,7 @@ public static synchronized void startupServer() throws IOException

System.setProperty("cassandra-foreground", "1");

final CassandraDaemon daemon = new CassandraDaemon();
daemon = new CassandraDaemon();

try
{
Expand Down Expand Up @@ -284,6 +286,16 @@ public void run()
}
}

public static synchronized void stopServer()
{
if (!cassandraStarted)
return;

daemon.deactivate();
daemon = null;
cassandraStarted = false;
}

public static void createCassandraSchema() throws IOException
{
if (!cassandraStarted)
Expand Down

0 comments on commit 60ce47c

Please sign in to comment.