class
CouchDB::Replication::Session
- CouchDB::Replication::Session
- Reference
- Object
Overview
Result object returned by Database#replicate_to, #replicate_from, and #sync.
Carries transfer statistics for one replication run. Check ok first; if it is
false, #error contains the failure message.
session = local.replicate_to(remote)
puts session.ok? # true / false
puts session.docs_written # number of documents transferred
puts session.last_seq # last sequence number processed
Defined in:
couchdb/replication/session.crConstructors
-
.new(source_url : String, target_url : String)
Creates a new session for a replication from source_url to target_url.
Instance Method Summary
-
#doc_write_failures : Int32
Total number of documents that failed to write to the target.
-
#docs_read : Int32
Total number of documents fetched from the source.
-
#docs_written : Int32
Total number of documents successfully written to the target.
-
#error : String | Nil
Error message when
okisfalse;nilon success. -
#fail!(message : String)
Records an error message and marks the session as failed.
-
#finish!
Marks the session as successful.
-
#last_seq : String
Last sequence number processed by this replication run.
-
#ok? : Bool
truewhen replication completed without error,falseotherwise. -
#record_batch(read : Int32, written : Int32, failures : Int32, seq : String)
Accumulates statistics from one replication batch.
-
#source_url : String
Name or URL of the replication source.
-
#target_url : String
Name or URL of the replication target.
-
#to_s(io : IO)
Returns a human-readable summary of the replication session.
Constructor Detail
Creates a new session for a replication from source_url to target_url.
All counters start at zero and ok starts as false until #finish! is called.
Instance Method Detail
Accumulates statistics from one replication batch. Called by Replicator after
each batch of documents is processed.