Interface KeyspacePopulator

All Known Implementing Classes:
CompositeKeyspacePopulator, ResourceKeyspacePopulator
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface KeyspacePopulator
Strategy used to populate, initialize, or clean up a Cassandra keyspace.
Since:
3.0
Author:
Mark Paluch
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    populate(com.datastax.oss.driver.api.core.CqlSession session)
    Populate, initialize, or clean up the database using the provided CqlSession connection.
  • Method Details

    • populate

      void populate(com.datastax.oss.driver.api.core.CqlSession session) throws ScriptException
      Populate, initialize, or clean up the database using the provided CqlSession connection.

      Concrete implementations may throw a RuntimeException if an error is encountered but are strongly encouraged to throw a specific ScriptException instead. For example, Spring's ResourceKeyspacePopulator wrap all exceptions in ScriptExceptions.

      Parameters:
      session - the CQL CqlSession to use to populate the keyspace; already configured and ready to use; never null
      Throws:
      ScriptException - in all other error cases