def this()

in core/src/main/scala/org/apache/pekko/persistence/cassandra/cleanup/Cleanup.scala [56:89]


  def this(systemProvider: ClassicActorSystemProvider) =
    this(
      systemProvider,
      new CleanupSettings(
        systemProvider.classicSystem.settings.config.getConfig("pekko.persistence.cassandra.cleanup")))

  private implicit val system: ActorSystem = systemProvider.classicSystem
  import settings._
  import system.dispatcher

  private val log = Logging(system, classOf[Cleanup])

  // operations on journal, snapshotStore and tagViews should be only be done when dry-run = false
  private val journal: ActorRef = Persistence(system).journalFor(pluginLocation + ".journal")
  private lazy val snapshotStore: ActorRef = Persistence(system).snapshotStoreFor(pluginLocation + ".snapshot")
  private lazy val tagViewsReconciliation = new Reconciliation(
    system,
    new ReconciliationSettings(system.settings.config.getConfig(pluginLocation + ".reconciler")))

  private implicit val askTimeout: Timeout = operationTimeout

  private lazy val session: CassandraSession =
    CassandraSessionRegistry(system).sessionFor(pluginLocation)

  private lazy val pluginSettings = PluginSettings(system, system.settings.config.getConfig(pluginLocation))
  private lazy val statements = new CassandraSnapshotStatements(pluginSettings.snapshotSettings)
  private val selectLatestSnapshotsPs = RetryableFutureEval(() =>
    session.prepare(statements.selectLatestSnapshotMeta))
  private val selectAllSnapshotMetaPs = RetryableFutureEval(() =>
    session.prepare(statements.selectAllSnapshotMeta))

  if (dryRun) {
    log.info("Cleanup running in dry run mode. No operations will be executed against the database, only logged")
  }