couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Replication" by RobertNewson
Date Mon, 15 Apr 2013 11:53:17 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The "Replication" page has been changed by RobertNewson:
http://wiki.apache.org/couchdb/Replication?action=diff&rev1=54&rev2=55

  
  === Cancel replication ===
  
+ ==== Before 1.2.0 ====
+ 
  A replication triggered by POSTing to '''/_replicate/''' can be canceled by POSTing the
exact same JSON object but with the additional '''"cancel"''' property set to the boolean
''true'' value.
  
  {{{
@@ -61, +63 @@

  }}}
  
  Notice: the request which initiated the replication will fail with error 500 (shutdown).
+ 
+ ==== from 1.2.0 onward ====
  
  Starting from CouchDB version 1.2.0, the original replication object no longer needs to
be known. Instead a simple JSON object with the fields '''"replication_id"''' (a string) and
'''"cancel"''' (set to the boolean ''true'' value) is enough. The names ''_local_id'' and
''id'' are aliases to ''replication_id''. The replication ID can be obtained from the original
replication request (if it's a continuous replication), from '''_active_tasks''' or from the
log. Example:
  
@@ -72, +76 @@

  {"ok":true,"_local_id":"0a81b645497e6270611ec3419767a584+continuous+create_target"}
  }}}
  
- 
  === Continuous replication ===
  
  To make replication continuous, add "continuous":true parameter to JSON, for example:
@@ -84, +87 @@

  }}}
  CouchDB can persist continuous replications over a server restart. For more, see the {{{_replicator}}}
database below.
  
- === Cancelling a continuous replication task ===
- To cancel a continuous replication task, add "cancel":true parameter to JSON, for example:
- 
- {{{
- POST /_replicate HTTP/1.1
- 
- {"source":"http://example.org/example-database","target":"http://admin:password@127.0.0.1:5984/example-database",
"continuous":true, "cancel":true}
- }}}
  === Filtered Replication ===
  Sometimes you don't want to transfer all documents from source to target. You can include
one or more filter functions in a design document on the source and then tell the replicator
to use them.
  

Mime
View raw message