Packages

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
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. CassandraLauncher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. class CleanFailedException extends RuntimeException

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val DefaultTestConfigResource: String

    Default config for testing "test-embedded-cassandra.yaml"

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. 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()
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. 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 randomPort clean can be defined with -DCassandraLauncher.clean=true, default is false directory can be defined with -DCassandraLauncher.directory=target/embedded-cassandra, default is target/embedded-cassandra configResource yaml configuration loaded from classpath, can be defined with -DCassandraLauncher.configResource=test-embedded-cassandra.yaml, default is defined in CassandraLauncher#DefaultTestConfigResource, i.e. test-embedded-cassandra.yaml

  15. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. lazy val randomPort: Int

    The random free port that will be used if port=0 is specified in the start method.

    The random free port that will be used if port=0 is specified in the start method.

    Calling randomPort before start is not recommended. It will fix the value and won't necessarily reflect the value that is effectively used by the launcher.

  19. 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 if clean is true and removal of the directory fails

  20. 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 if clean is true and removal of the directory fails

  21. 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 if clean is true and removal of the directory fails

  22. def stop(): Unit

    Stops Cassandra.

    Stops Cassandra. However, it will not be possible to start Cassandra again in same JVM.

  23. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  26. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  27. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def freePort(): Int
    Annotations
    @deprecated
    Deprecated

    (Since version 0.104) Internal API, will be removed in future release

Inherited from AnyRef

Inherited from Any

Ungrouped