|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.pipeline.StageProgressTracker
public class StageProgressTracker
Tracks the current status of replication and implements event watches. This class maintains a clear distinction between the latest event processed and the latest event committed. The methods to get these values are designated "dirty" and "committed" respectively to make this distinction as clear as possible.
| Constructor Summary | |
|---|---|
StageProgressTracker(java.lang.String name,
int threadCount)
Creates a new stage process tracker. |
|
| Method Summary | |
|---|---|
boolean |
allCancelled()
Return true if all task are cancelled. |
void |
cancel(int taskId)
Signal that task has been cancelled. |
void |
cancelAll()
Signal that all tasks have been cancelled. |
java.util.List<TaskProgress> |
cloneTaskProgress()
Returns a list of cloned task progress instances ordered by task ID. |
void |
commit(int taskId)
Records the last committed event. |
long |
getCommittedApplyLatency()
Return the latency of the last committed event. |
ReplDBMSHeader |
getCommittedMinEvent()
Return the last committed event. |
long |
getCommittedMinSeqno()
Return the last safely committed sequence number. |
ReplDBMSHeader |
getDirtyLastProcessedEvent(int taskId)
Return last event that we have seen. |
ReplDBMSHeader |
getDirtyMinLastEvent()
Return the last processed event or null if none such exists. |
long |
getDirtyMinLastSeqno()
Return the last processed sequence number or -1 if no event exists. |
java.util.List<ShardProgress> |
getShardProgress()
Returns a list of shard progress instances ordered by shard ID. |
TaskProgress |
getTaskProgress(int taskId)
Return underlying progress instance for a particular task. |
java.util.List<Watch<?>> |
getWatches(boolean committed)
Returns current watches. |
boolean |
isCancelled(int taskId)
Return true if task has been cancelled. |
void |
release()
Release progress tracker resources. |
void |
setApplySkipCount(long applySkipCount)
Set the number of events to skip after going online. |
void |
setInitialLastProcessedEvent(int taskId,
ReplDBMSHeader replEvent)
|
void |
setLastProcessedEvent(int taskId,
ReplDBMSHeader replEvent)
Set the last processed event, which triggers checks for watches. |
void |
setLoggingInterval(long loggingInterval)
Print a log message every time we process this many events. |
void |
setSeqnosToBeSkipped(java.util.SortedSet<java.lang.Long> seqnosToBeSkipped)
Set a list of one or more events to skip. |
void |
setUpstreamStore(ParallelStore upstreamStore)
Sets the upstream parallel store, if such a thing exists. |
boolean |
shouldInterruptTask()
Return true if we need to interrupt the task(s) after cancellation. |
boolean |
skip(ReplDBMSEvent event)
Returns false if the current event should be skipped. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForCommittedSequenceNumber(long seqno,
boolean cancel)
Sets a watch for a particular sequence number to be safely committed on all channels. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedEventId(java.lang.String eventId,
boolean cancel)
Sets a watch for a particular event ID to be processed. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedHeartbeat(java.lang.String name,
boolean cancel)
Sets a watch for a heartbeat event to be extracted. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedSequenceNumber(long seqno,
boolean cancel)
Sets a watch for a particular sequence number to be processed. |
java.util.concurrent.Future<ReplDBMSHeader> |
watchForProcessedTimestamp(java.sql.Timestamp timestamp,
boolean cancel)
Sets a watch for a particular source timestamp to be extracted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StageProgressTracker(java.lang.String name,
int threadCount)
name - | Method Detail |
|---|
public void setUpstreamStore(ParallelStore upstreamStore)
public void setLoggingInterval(long loggingInterval)
public void setApplySkipCount(long applySkipCount)
public void setSeqnosToBeSkipped(java.util.SortedSet<java.lang.Long> seqnosToBeSkipped)
public ReplDBMSHeader getDirtyLastProcessedEvent(int taskId)
public ReplDBMSHeader getDirtyMinLastEvent()
public long getDirtyMinLastSeqno()
public long getCommittedMinSeqno()
public long getCommittedApplyLatency()
public ReplDBMSHeader getCommittedMinEvent()
public java.util.List<TaskProgress> cloneTaskProgress()
public TaskProgress getTaskProgress(int taskId)
public java.util.List<ShardProgress> getShardProgress()
public void setLastProcessedEvent(int taskId,
ReplDBMSHeader replEvent)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void setInitialLastProcessedEvent(int taskId,
ReplDBMSHeader replEvent)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void commit(int taskId)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void cancel(int taskId)
public boolean isCancelled(int taskId)
public void cancelAll()
public boolean allCancelled()
public boolean shouldInterruptTask()
public void release()
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedSequenceNumber(long seqno,
boolean cancel)
throws java.lang.InterruptedException
seqno - Sequence number to watch forcancel - If true, terminate task when watch is successful
java.lang.InterruptedException
public java.util.concurrent.Future<ReplDBMSHeader> watchForCommittedSequenceNumber(long seqno,
boolean cancel)
throws java.lang.InterruptedException
seqno - Sequence number to watch forcancel - If true, terminate task when watch is successful
java.lang.InterruptedException
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedEventId(java.lang.String eventId,
boolean cancel)
throws java.lang.InterruptedException
eventId - Native event ID to watch forcancel - If true, terminate task when watch is successful
java.lang.InterruptedException
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedHeartbeat(java.lang.String name,
boolean cancel)
throws java.lang.InterruptedException
cancel - If true, terminate task when watch is successful
java.lang.InterruptedException
public java.util.concurrent.Future<ReplDBMSHeader> watchForProcessedTimestamp(java.sql.Timestamp timestamp,
boolean cancel)
throws java.lang.InterruptedException
timestamp - Timestame to watch forcancel - If true, terminate task when watch is successful
java.lang.InterruptedExceptionpublic java.util.List<Watch<?>> getWatches(boolean committed)
committed - If true returned watches for committed eventspublic boolean skip(ReplDBMSEvent event)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||