Liking cljdoc? Tell your friends :D

com.fulcrologic.datomic-cloud-backup.continuous-restore

Continuous restore functionality that polls a TransactionStore and applies new segments to a target database as they become available.

This namespace provides background restore that:

  • Pre-fetches segments ahead of the consumer using core.async
  • Uses exponential backoff on errors
  • Supports graceful shutdown via a running? flag
  • Logs structured maps for CloudWatch integration
Continuous restore functionality that polls a TransactionStore and applies
new segments to a target database as they become available.

This namespace provides background restore that:
- Pre-fetches segments ahead of the consumer using core.async
- Uses exponential backoff on errors
- Supports graceful shutdown via a running? flag
- Logs structured maps for CloudWatch integration
raw docstring

continuous-restore!clj

(continuous-restore! source-database-name
                     target-conn
                     transaction-store
                     running?
                     options)

Continuously restore from a TransactionStore with polling.

Arguments:

  • source-database-name: Name used for this backup/restore
  • target-conn: Connection to target database
  • transaction-store: A TransactionStore implementation
  • running?: A derefable (e.g., volatile!) - set to false to stop
  • options map:
    • :poll-interval-ms - Sleep time when caught up (default 5000)
    • :prefetch-buffer - Number of segments to pre-fetch (default 5)
    • :max-retry-delay-ms - Maximum backoff delay on errors (default 300000 = 5 min)
    • :blacklist - Set of attributes to exclude from restore
    • :rewrite - Map of attribute -> rewrite fn
    • :verify? - Enable ID verification (default true)

Returns: A channel that receives the final result when stopped

The restore runs in background threads. It:

  1. Starts a prefetch producer to load segments ahead
  2. Consumes segments and restores them
  3. When caught up (no new segments), sleeps poll-interval-ms
  4. On errors, uses exponential backoff (1s -> 2s -> 4s -> ... -> max-retry-delay-ms)
  5. Stops when @running? is false
Continuously restore from a TransactionStore with polling.

Arguments:
- source-database-name: Name used for this backup/restore
- target-conn: Connection to target database
- transaction-store: A TransactionStore implementation
- running?: A derefable (e.g., volatile!) - set to false to stop
- options map:
  - :poll-interval-ms - Sleep time when caught up (default 5000)
  - :prefetch-buffer - Number of segments to pre-fetch (default 5)
  - :max-retry-delay-ms - Maximum backoff delay on errors (default 300000 = 5 min)
  - :blacklist - Set of attributes to exclude from restore
  - :rewrite - Map of attribute -> rewrite fn
  - :verify? - Enable ID verification (default true)

Returns: A channel that receives the final result when stopped

The restore runs in background threads. It:
1. Starts a prefetch producer to load segments ahead
2. Consumes segments and restores them
3. When caught up (no new segments), sleeps poll-interval-ms
4. On errors, uses exponential backoff (1s -> 2s -> 4s -> ... -> max-retry-delay-ms)
5. Stops when @running? is false
sourceraw docstring

initial-retry-delay-msclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close