object CassandraLauncher
Starts Cassandra in current JVM. There can only be one Cassandra instance per JVM, but keyspaces can be used for isolation.
- Source
- CassandraLauncher.scala
- Alphabetic
- By Inheritance
- CassandraLauncher
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- class CleanFailedException extends RuntimeException
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val DefaultTestConfigResource: String
Default config for testing "test-embedded-cassandra.yaml"
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def classpathForResources(resources: String*): Seq[String]
Use this to locate classpath elements from the current classpath to add to the classpath of the launched Cassandra.
Use this to locate classpath elements from the current classpath to add to the classpath of the launched Cassandra.
This is particularly useful if you want a custom logging, you can use this to ensure that the directory that your log file is in is on the classpath of the forked Cassandra process, for example:
CassandraLauncher.start( cassandraDirectory, CassandraLauncher.DefaultTestConfigResource, clean = true, port = 0, CassandraLauncher.classpathForResources("logback.xml") )
Files ending with
assembly.jar
are not included in the result because an assembly jar will likely contain incompatible classes that shouldn't be on the classpath of the Cassandra server, such as incompatible dependency of Guava. Assembly jars are used when running multi-node testing.- Annotations
- @varargs()
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def main(args: Array[String]): Unit
Main method to start Cassandra, see #start.
Main method to start Cassandra, see #start. Note that
cassandra-all
jar must be in classpath.port can be defined with
-DCassandraLauncher.port=4000, default is the
randomPortclean
can be defined with, default is
falsedirectory
can be defined with, default is
target/embedded-cassandraconfigResource
yaml configuration loaded from classpath, can be defined with, default is defined in CassandraLauncher#DefaultTestConfigResource, i.e.
test-embedded-cassandra.yaml - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- lazy val randomPort: Int
The random free port that will be used if
port=0
is specified in thestart
method.The random free port that will be used if
port=0
is specified in thestart
method.Calling
randomPort
beforestart
is not recommended. It will fix the value and won't necessarily reflect the value that is effectively used by the launcher. - def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int, classpath: Seq[String], host: Option[String]): Unit
Start Cassandra
Start Cassandra
- cassandraDirectory
the data directory to use
- configResource
yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource
- clean
if
true
all files in the data directory will be deleted before starting Cassandra- port
the
native_transport_port
to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.- classpath
Any additional jars/directories to add to the classpath. Use CassandraLauncher#classpathForResources to assist in calculating this.
- host
the host to bind the embeded Cassandra to. If None, then 127.0.0.1 is used.
- Exceptions thrown
org.apache.pekko.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException
ifclean
istrue
and removal of the directory fails
- def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int, classpath: Seq[String]): Unit
Start Cassandra
Start Cassandra
- cassandraDirectory
the data directory to use
- configResource
yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource
- clean
if
true
all files in the data directory will be deleted before starting Cassandra- port
the
native_transport_port
to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.- classpath
Any additional jars/directories to add to the classpath. Use CassandraLauncher#classpathForResources to assist in calculating this.
- Exceptions thrown
org.apache.pekko.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException
ifclean
istrue
and removal of the directory fails
- def start(cassandraDirectory: File, configResource: String, clean: Boolean, port: Int): Unit
Start Cassandra
Start Cassandra
- cassandraDirectory
the data directory to use
- configResource
yaml configuration loaded from classpath, default configuration for testing is defined in CassandraLauncher#DefaultTestConfigResource
- clean
if
true
all files in the data directory will be deleted before starting Cassandra- port
the
native_transport_port
to use, if 0 a random free port is used, which can be retrieved (before starting) with CassandraLauncher.randomPort.
- Exceptions thrown
org.apache.pekko.persistence.cassandra.testkit.CassandraLauncher.CleanFailedException
ifclean
istrue
and removal of the directory fails
- def stop(): Unit
Stops Cassandra.
Stops Cassandra. However, it will not be possible to start Cassandra again in same JVM.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()