com.continuent.tungsten.replicator.pipeline
Class TaskProgress

java.lang.Object
  extended by com.continuent.tungsten.replicator.pipeline.TaskProgress

public class TaskProgress
extends java.lang.Object

Tracks statistics for an individual task, which is identified by a task ID.

Version:
1.0
Author:
Robert Hodges

Constructor Summary
TaskProgress(TaskProgress other)
          Create a clone of a current instance.
 
Method Summary
 void begin()
          Start the task progress timer.
 void beginApplyInterval()
          Start an apply interval.
 void beginExtractInterval()
          Start an extract interval.
 void beginFilterInterval()
          Start a filter interval.
 TaskProgress clone()
          Returns a shallow copy of this instance.
 void endApplyInterval()
          Add time for an apply operation interval.
 void endExtractInterval()
          Add time for an extract operation interval.
 void endFilterInterval()
          Add time for a filter operation interval.
 long getApplyLatencyMillis()
          Return apply latency in milliseconds.
 double getApplyLatencySeconds()
          Return apply latency in seconds.
 double getAverageBlockSize()
           
 long getBlockCount()
           
 long getCurrentBlockSize()
           
 long getEndMillis()
          Returns the current end time for measuring intervals.
 long getEventCount()
           
 long getEventCountAtLastCommit()
           
 long getLastCommitMillis()
           
 long getLastCommittedBlockMillis()
           
 long getLastCommittedBlockSize()
           
 double getLastCommittedBlockTime()
          Return time in seconds of last committed block.
 ReplDBMSHeader getLastCommittedEvent()
           
 ReplDBMSHeader getLastProcessedEvent()
           
 java.lang.String getStageName()
           
 long getStartMillis()
          Returns the start time of the task.
 TaskState getState()
          Returns the current task state.
 int getTaskId()
           
 long getTotalApplyMillis()
          Returns cumulative extract time in milliseconds.
 double getTotalApplySeconds()
          Return apply time in seconds.
 long getTotalExtractMillis()
          Returns cumulative extract time in milliseconds.
 double getTotalExtractSeconds()
          Return extract time in seconds.
 long getTotalFilterMillis()
          Returns cumulative filter time in milliseconds
 double getTotalFilterSeconds()
          Return filter time in seconds.
 long getTotalOtherMillis()
          Returns remaining wall-clock time outside of extract/filter/apply.
 double getTotalOtherSeconds()
          Return other time in seconds.
 void incrementEventCount()
           
 boolean isCancelled()
           
 void setApplyLatencyMillis(long applyLatencyMillis)
           
 void setCancelled(boolean cancelled)
           
 void setEventCount(long eventCount)
           
 void setEventCountAtLastCommit(long eventCountAtLastCommit)
           
 void setLastCommittedBlockSize(long lastCommittedBlockSize)
           
 void setLastCommittedEvent(ReplDBMSHeader lastCommittedEvent)
           
 void setLastProcessedEvent(ReplDBMSHeader lastEvent)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskProgress

public TaskProgress(TaskProgress other)
Create a clone of a current instance.

Method Detail

begin

public void begin()
Start the task progress timer. Should be called when a task thread begins processing.


getStageName

public java.lang.String getStageName()

getTaskId

public int getTaskId()

getLastProcessedEvent

public ReplDBMSHeader getLastProcessedEvent()

setLastProcessedEvent

public void setLastProcessedEvent(ReplDBMSHeader lastEvent)

getLastCommittedEvent

public ReplDBMSHeader getLastCommittedEvent()

setLastCommittedEvent

public void setLastCommittedEvent(ReplDBMSHeader lastCommittedEvent)

getLastCommittedBlockMillis

public long getLastCommittedBlockMillis()

getLastCommitMillis

public long getLastCommitMillis()

isCancelled

public boolean isCancelled()

setCancelled

public void setCancelled(boolean cancelled)

getEventCount

public long getEventCount()

setEventCount

public void setEventCount(long eventCount)

getEventCountAtLastCommit

public long getEventCountAtLastCommit()

setEventCountAtLastCommit

public void setEventCountAtLastCommit(long eventCountAtLastCommit)

incrementEventCount

public void incrementEventCount()

getBlockCount

public long getBlockCount()

getAverageBlockSize

public double getAverageBlockSize()

getCurrentBlockSize

public long getCurrentBlockSize()

getLastCommittedBlockSize

public long getLastCommittedBlockSize()

setLastCommittedBlockSize

public void setLastCommittedBlockSize(long lastCommittedBlockSize)

getLastCommittedBlockTime

public double getLastCommittedBlockTime()
Return time in seconds of last committed block.


getApplyLatencyMillis

public long getApplyLatencyMillis()
Return apply latency in milliseconds. Sub-zero values are rounded to 0.


getApplyLatencySeconds

public double getApplyLatencySeconds()
Return apply latency in seconds.


setApplyLatencyMillis

public void setApplyLatencyMillis(long applyLatencyMillis)

getStartMillis

public long getStartMillis()
Returns the start time of the task.


getEndMillis

public long getEndMillis()
Returns the current end time for measuring intervals.


getTotalExtractMillis

public long getTotalExtractMillis()
Returns cumulative extract time in milliseconds.


getTotalExtractSeconds

public double getTotalExtractSeconds()
Return extract time in seconds.


beginExtractInterval

public void beginExtractInterval()
Start an extract interval.


endExtractInterval

public void endExtractInterval()
Add time for an extract operation interval.


getTotalFilterMillis

public long getTotalFilterMillis()
Returns cumulative filter time in milliseconds


getTotalFilterSeconds

public double getTotalFilterSeconds()
Return filter time in seconds.


beginFilterInterval

public void beginFilterInterval()
Start a filter interval.


endFilterInterval

public void endFilterInterval()
Add time for a filter operation interval.


getTotalApplyMillis

public long getTotalApplyMillis()
Returns cumulative extract time in milliseconds.


getTotalApplySeconds

public double getTotalApplySeconds()
Return apply time in seconds.


beginApplyInterval

public void beginApplyInterval()
Start an apply interval.


endApplyInterval

public void endApplyInterval()
Add time for an apply operation interval.


getTotalOtherMillis

public long getTotalOtherMillis()
Returns remaining wall-clock time outside of extract/filter/apply.


getTotalOtherSeconds

public double getTotalOtherSeconds()
Return other time in seconds.


getState

public TaskState getState()
Returns the current task state.


clone

public TaskProgress clone()
Returns a shallow copy of this instance.

Overrides:
clone in class java.lang.Object