List of usage examples for org.apache.cassandra.service CassandraDaemon init
public void init(String[] arguments) throws IOException
From source file:com.github.pmerienne.trident.state.cassandra.embedded.CassandraEmbeddedServerStarter.java
License:Apache License
public void start(final CassandraConfig config) { if (isAlreadyRunning()) { log.info("Cassandra is already running, not starting new one"); return;//ww w .java 2 s . c om } log.info("Starting Cassandra..."); config.write(); System.setProperty("cassandra.config", "file:" + config.getConfigFile().getAbsolutePath()); System.setProperty("cassandra-foreground", "true"); final CountDownLatch startupLatch = new CountDownLatch(1); executor = Executors.newSingleThreadExecutor(); executor.execute(new Runnable() { @Override public void run() { try { CassandraDaemon cassandraDaemon = new CassandraDaemon(); cassandraDaemon.init(null); cassandraDaemon.start(); startupLatch.countDown(); } catch (IOException e) { throw new RuntimeException(e); } // cassandraDaemon.activate(); } }); try { startupLatch.await(30, SECONDS); } catch (InterruptedException e) { log.error("Timeout starting Cassandra embedded", e); throw new IllegalStateException("Timeout starting Cassandra embedded", e); } }