com.continuent.tungsten.replicator.pipeline
Class SingleThreadStageTask

java.lang.Object
  extended by com.continuent.tungsten.replicator.pipeline.SingleThreadStageTask
All Implemented Interfaces:
java.lang.Runnable

public class SingleThreadStageTask
extends java.lang.Object
implements java.lang.Runnable

Implements thread logic for single-threaded stage execution. If your name is not one of the two people listed below you probably should not change this code without deep reflection and a lot of regression tests. *Every* line in the task run loop is here for a reason.

Author:
Robert Hodges, Stephane Giron

Constructor Summary
SingleThreadStageTask(Stage stage, int taskId)
           
 
Method Summary
 void cancel()
          Cancel a currently running task.
 void execShutdownHooks(PluginContext context)
          Invoke shutdown hooks (if any) defined on components of this task.
 Applier getApplier()
           
 Extractor getExtractor()
           
 java.util.List<Filter> getFilters()
           
 java.lang.String getName()
           
 int getTaskId()
          Returns the id of this task.
 void reportInitialPosition(ReplDBMSHeader lastHeader)
           
 void run()
          Perform thread processing logic.
 void runTask()
          Perform single-threaded stage processing.
 void setApplier(Applier applier)
           
 void setEventDispatcher(com.continuent.tungsten.fsm.event.EventDispatcher eventDispatcher)
          Sets the event dispatcher.
 void setExtractor(Extractor extractor)
           
 void setFilters(java.util.List<Filter> filters)
           
 void setSchedule(Schedule schedule)
          Sets the schedule instance used to control loop continuation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleThreadStageTask

public SingleThreadStageTask(Stage stage,
                             int taskId)
Method Detail

getTaskId

public int getTaskId()
Returns the id of this task.


setEventDispatcher

public void setEventDispatcher(com.continuent.tungsten.fsm.event.EventDispatcher eventDispatcher)
Sets the event dispatcher.


setSchedule

public void setSchedule(Schedule schedule)
Sets the schedule instance used to control loop continuation.


setExtractor

public void setExtractor(Extractor extractor)

setFilters

public void setFilters(java.util.List<Filter> filters)

setApplier

public void setApplier(Applier applier)

getExtractor

public Extractor getExtractor()

getFilters

public java.util.List<Filter> getFilters()

getApplier

public Applier getApplier()

getName

public java.lang.String getName()

cancel

public void cancel()
Cancel a currently running task.


run

public void run()
Perform thread processing logic.

Specified by:
run in interface java.lang.Runnable

runTask

public void runTask()
Perform single-threaded stage processing.

Throws:
ReplicatorException

execShutdownHooks

public void execShutdownHooks(PluginContext context)
                       throws java.lang.InterruptedException
Invoke shutdown hooks (if any) defined on components of this task.

Parameters:
context - Plugin context
Throws:
java.lang.InterruptedException

reportInitialPosition

public void reportInitialPosition(ReplDBMSHeader lastHeader)
                           throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException