org.ektorp.impl
Class StdReplicationTask

java.lang.Object
  extended by org.ektorp.impl.StdActiveTask
      extended by org.ektorp.impl.StdReplicationTask
All Implemented Interfaces:
ActiveTask, ReplicationTask

public class StdReplicationTask
extends StdActiveTask
implements ReplicationTask


Constructor Summary
StdReplicationTask()
           
 
Method Summary
 long getCheckpointedSourceSequenceId()
           
 Long getCheckpointInterval()
          Defines replication checkpoint interval in milliseconds.
 String getReplicationDocumentId()
           
 String getReplicationId()
           
 String getSourceDatabaseName()
           
 long getSourceSequenceId()
           
 String getTargetDatabaseName()
           
 long getTotalMissingRevisions()
           
 long getTotalReads()
           
 long getTotalRevisionsChecked()
           
 long getTotalWrites()
           
 long getWriteFailures()
           
 boolean isContinuous()
           
 void setCheckpointedSourceSequenceId(long checkpointedSourceSequenceId)
           
 void setCheckpointInterval(Long checkpointInterval)
           
 void setContinuous(boolean isContinuous)
           
 void setReplicationDocumentId(String replicationDocumentId)
           
 void setReplicationId(String replicationId)
           
 void setSourceDatabase(String sourceDatabase)
           
 void setSourceSequenceId(long sourceSequenceId)
           
 void setTargetDatabase(String targetDatabase)
           
 void setTotalMissingRevisions(long totalMissingRevisions)
           
 void setTotalReads(long totalReads)
           
 void setTotalRevisionsChecked(long totalRevisionsChecked)
           
 void setTotalWrites(long totalWrites)
           
 void setWriteFailures(long writeFailures)
           
 
Methods inherited from class org.ektorp.impl.StdActiveTask
getPid, getProgress, getStartedOn, getUpdatedOn, setPid, setProgress, setStartedOn, setUpdatedOn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ektorp.ActiveTask
getPid, getProgress, getStartedOn, getUpdatedOn
 

Constructor Detail

StdReplicationTask

public StdReplicationTask()
Method Detail

getReplicationId

public String getReplicationId()
Specified by:
getReplicationId in interface ReplicationTask
Returns:
a unique ID for this replication task which can be used e.g. to cancel an ongoing replication (see http://wiki.apache.org/couchdb/Replication#from_1.2.0_onward)

setReplicationId

public void setReplicationId(String replicationId)

getReplicationDocumentId

public String getReplicationDocumentId()
Specified by:
getReplicationDocumentId in interface ReplicationTask
Returns:
the ID of the document which defines the replication rule being processed by this task

setReplicationDocumentId

public void setReplicationDocumentId(String replicationDocumentId)

isContinuous

public boolean isContinuous()
Specified by:
isContinuous in interface ReplicationTask
Returns:
a boolean indicating whether or not the replication rule being processed is continuous

setContinuous

public void setContinuous(boolean isContinuous)

getWriteFailures

public long getWriteFailures()
Specified by:
getWriteFailures in interface ReplicationTask
Returns:
the total number of document writes which have failed so far in this task

setWriteFailures

public void setWriteFailures(long writeFailures)

getTotalReads

public long getTotalReads()
Specified by:
getTotalReads in interface ReplicationTask
Returns:
the total number of document reads so far for this task

setTotalReads

public void setTotalReads(long totalReads)

getTotalWrites

public long getTotalWrites()
Specified by:
getTotalWrites in interface ReplicationTask
Returns:
the total number of successful document writes so far for this task

setTotalWrites

public void setTotalWrites(long totalWrites)

getTotalMissingRevisions

public long getTotalMissingRevisions()
Specified by:
getTotalMissingRevisions in interface ReplicationTask
Returns:
the number of documents in the target DB which have been found to be either missing or out of date. This number can be incremented more than once for the same document: for example if a document is updated while a continuous replication rule is active. It won't however be increased by more than 1 if a document is out of date by more than one revision: for example if document X is at revision 3 in Source and revision 1 in Target, this number only increases by 1 when document X is checked.

setTotalMissingRevisions

public void setTotalMissingRevisions(long totalMissingRevisions)

getTotalRevisionsChecked

public long getTotalRevisionsChecked()
Specified by:
getTotalRevisionsChecked in interface ReplicationTask
Returns:
the number of documents from the source DB whose presence and revision number in the target DB have been checked. This number can be incremented more than once for the same document: for example if a document is updated while a continuous replication rule is active, it will be checked again. It won't however count multiple revisions of the same document each time it's checked: for example if a document is at revision 3 the first time it's checked, this count will still only increase by 1.

setTotalRevisionsChecked

public void setTotalRevisionsChecked(long totalRevisionsChecked)

getSourceDatabaseName

public String getSourceDatabaseName()
Specified by:
getSourceDatabaseName in interface ReplicationTask
Returns:
the name of the source database for this task

setSourceDatabase

public void setSourceDatabase(String sourceDatabase)

getTargetDatabaseName

public String getTargetDatabaseName()
Specified by:
getTargetDatabaseName in interface ReplicationTask
Returns:
the name of the target database for this task

setTargetDatabase

public void setTargetDatabase(String targetDatabase)

getSourceSequenceId

public long getSourceSequenceId()
Specified by:
getSourceSequenceId in interface ReplicationTask
Returns:
the sequence number of the source database

setSourceSequenceId

public void setSourceSequenceId(long sourceSequenceId)

getCheckpointedSourceSequenceId

public long getCheckpointedSourceSequenceId()
Specified by:
getCheckpointedSourceSequenceId in interface ReplicationTask
Returns:
the latest sequence number of the source database which has been processed by this task

setCheckpointedSourceSequenceId

public void setCheckpointedSourceSequenceId(long checkpointedSourceSequenceId)

getCheckpointInterval

public Long getCheckpointInterval()
Description copied from interface: ReplicationTask
Defines replication checkpoint interval in milliseconds. Replicator will requests from the Source database at the specified interval

Specified by:
getCheckpointInterval in interface ReplicationTask

setCheckpointInterval

public void setCheckpointInterval(Long checkpointInterval)


Copyright © 2017. All rights reserved.