com.continuent.tungsten.replicator.pipeline
Interface Schedule

All Known Implementing Classes:
SimpleSchedule

public interface Schedule

Denotes a schedule, which monitors and directs task execution.

Version:
1.0
Author:
Robert Hodges

Field Summary
static int CONTINUE_NEXT
          Continue with the next event.
static int CONTINUE_NEXT_COMMIT
          Continue with next event but commit current position.
static int PROCEED
          Proceed with event processing.
static int QUIT
          Commit current transaction and terminate task processing loop.
 
Method Summary
 int advise(ReplEvent replEvent)
          Task must call this method after extracting event but before processing to decide disposition.
 void commit()
          Marks the last processed exception as committed.
 boolean isCancelled()
          Returns true if the task is canceled.
 void setLastProcessedEvent(ReplDBMSHeader event)
          Set the last processed event, which triggers checks for watches.
 void taskEnd()
          Task must call this method before exit to tell the schedule that it has completed.
 

Field Detail

PROCEED

static final int PROCEED
Proceed with event processing.

See Also:
Constant Field Values

QUIT

static final int QUIT
Commit current transaction and terminate task processing loop.

See Also:
Constant Field Values

CONTINUE_NEXT

static final int CONTINUE_NEXT
Continue with the next event.

See Also:
Constant Field Values

CONTINUE_NEXT_COMMIT

static final int CONTINUE_NEXT_COMMIT
Continue with next event but commit current position.

See Also:
Constant Field Values
Method Detail

advise

int advise(ReplEvent replEvent)
           throws java.lang.InterruptedException
Task must call this method after extracting event but before processing to decide disposition.

Returns:
A disposition for the event.
Throws:
java.lang.InterruptedException - Thrown if thread is interrupted

taskEnd

void taskEnd()
Task must call this method before exit to tell the schedule that it has completed.


setLastProcessedEvent

void setLastProcessedEvent(ReplDBMSHeader event)
                           throws java.lang.InterruptedException
Set the last processed event, which triggers checks for watches. If a fulfilled watch directs the task to terminate, the isCancelled call will return true.

Throws:
java.lang.InterruptedException - Thrown if thread is interrupted.

commit

void commit()
            throws java.lang.InterruptedException
Marks the last processed exception as committed. This information is used by upstream stages that implement synchronous pipeline processing, e.g., not dropping logs before they are safely committed downstream.

Throws:
java.lang.InterruptedException - Thrown if thread is interrupted.

isCancelled

boolean isCancelled()
Returns true if the task is canceled. Tasks must check this each iteration to decide whether to continue.