Class/Object

org.elevans.migration.cassandra

CqlMigrator

Related Docs: object CqlMigrator | package cassandra

Permalink

class CqlMigrator extends MigrationGraph[ResourceTransition] with LazyLogging

This utility can be used to:

NOTE: The optional 'alternateCurrentStateKeySpace' may be given to specify where the scope's current state tracking data should be stored. It defaults to None, in which case this data is stored in the Session's keyspace. A common case would be accept the default and to ensure that none of the CQL migration scripts attempt to change the Session's keyspace (e.g., via a 'USE' statement). In that case the scope's current state data will be stored in the same keyspace all of its other data. However, you may optionally provide an explicit 'alternateCurrentStateKeySpace' if for some reason you do not want the current state stored in the Session's keyspace (e.g., if some of the CQL scripts do change the Session's keyspace via 'USE' statements).

Author:

Eric Evans

Linear Supertypes
LazyLogging, MigrationGraph[ResourceTransition], AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. CqlMigrator
  2. LazyLogging
  3. MigrationGraph
  4. AnyRef
  5. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Instance Constructors

  1. new CqlMigrator(session: Session, scope: String, originState: String, transitionFinder: ResourceTransitionFinder, alternateCurrentStateKeySpace: Option[String] = None)

    Permalink

    session

    Cassandra session to use for executing CQL scripts and maintaining current state.

    scope

    scope of Cassandra objects manipulated by the CQL scripts.

    originState

    state that this scope is in before the first CQL script is executed (i.e., before any of them are created).

    transitionFinder

    ResourceTransitionFinder instance that can find resources that implement Transitions, and open each one as an InputStream.

    alternateCurrentStateKeySpace

    if defined, store the current state tracking data in this keyspace, creating it if it does not exist; defaults to None, in which case the current state tracking data is stored in the Session's keyspace.

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. val alternateCurrentStateKeySpace: Option[String]

    Permalink

    if defined, store the current state tracking data in this keyspace, creating it if it does not exist; defaults to None, in which case the current state tracking data is stored in the Session's keyspace.

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val currentStateKeySpace: String

    Permalink
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def execute(path: Seq[ResourceTransition]): Unit

    Permalink

    Execute the given sequence of transitions in order, if the first transition starts with the current state of the scope.

    Execute the given sequence of transitions in order, if the first transition starts with the current state of the scope.

    Exceptions thrown

    IllegalArgumentException if the first transition does not start with the current state of the scope

  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def getCurrentState: String

    Permalink

    Get the current state of this scope.

  14. def getNonDestructivePath(startState: String, endState: String): Option[Seq[ResourceTransition]]

    Permalink
    Definition Classes
    MigrationGraph
  15. def getNonDestructivePathFromCurrentState(endState: String): Option[Seq[ResourceTransition]]

    Permalink

    Return a non-destructive sequence of transitions (if any exists) that would migrate the scope from its current state to the given end state.

  16. def getPath(startState: String, endState: String): Option[Seq[ResourceTransition]]

    Permalink
    Definition Classes
    MigrationGraph
  17. def getPathFromCurrentState(endState: String): Option[Seq[ResourceTransition]]

    Permalink

    Return a sequence of transitions (if any exists) that would migrate the scope from its current state to the given end state.

  18. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  20. lazy val logger: Logger

    Permalink
    Attributes
    protected
    Definition Classes
    LazyLogging
  21. def migrateNonDestructiveTo(endState: String): Unit

    Permalink

    If a sequence of non-destructive transitions exists from the current state to the given end state, execute them in order.

    If a sequence of non-destructive transitions exists from the current state to the given end state, execute them in order.

    Exceptions thrown

    IllegalArgumentException if no sequence of non-destructive transitions exists from the current state to the requested end state

  22. def migrateTo(endState: String): Unit

    Permalink

    If a sequence of transitions exists from the current state to the given end state, execute them in order.

    If a sequence of transitions exists from the current state to the given end state, execute them in order.

    Exceptions thrown

    IllegalArgumentException if no sequence of transitions exists from the current state to the requested end state

  23. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  26. val originState: String

    Permalink

    state that this scope is in before the first CQL script is executed (i.e., before any of them are created).

  27. val scope: String

    Permalink

    scope of Cassandra objects manipulated by the CQL scripts.

  28. val session: Session

    Permalink

    Cassandra session to use for executing CQL scripts and maintaining current state.

  29. def setCurrentState(state: String): ResultSet

    Permalink

    Set the current state of this scope.

  30. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  31. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  32. val transitionFinder: ResourceTransitionFinder

    Permalink

    ResourceTransitionFinder instance that can find resources that implement Transitions, and open each one as an InputStream.

  33. lazy val transitions: Set[ResourceTransition]

    Permalink
    Definition Classes
    CqlMigrator → MigrationGraph
  34. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from LazyLogging

Inherited from MigrationGraph[ResourceTransition]

Inherited from AnyRef

Inherited from Any

Ungrouped