|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.thl.THLParallelReadTask
public class THLParallelReadTask
Performs coordinated reads on the THL on behalf of a particular client (a task thread) and buffers log records up to a local limit.
| Constructor Summary | |
|---|---|
THLParallelReadTask(int taskId,
THL thl,
Partitioner partitioner,
AtomicCounter headSeqnoCounter,
AtomicIntervalGuard<?> intervalGuard,
int maxSize,
int maxControlEvents,
int syncInterval,
com.continuent.tungsten.fsm.event.EventDispatcher dispatcher)
Instantiate a read task. |
|
| Method Summary | |
|---|---|
void |
addWatchSyncPredicate(WatchPredicate<ReplDBMSHeader> predicate)
Adds a watch predicate. |
ReplEvent |
get()
Removes and returns next event from the queue, blocking if empty. |
ReplEvent |
peek()
Returns but does not remove next event from the queue if it exists or returns null if queue is empty. |
void |
prepare(PluginContext context)
Connect to THL and seek start sequence number. |
void |
putControlEvent(ReplControlEvent controlEvent)
Inserts a control event. |
void |
release()
Terminate reader task and free all resources. |
void |
run()
Implements read loop on the log to feed event queue. |
void |
setRestartHeader(ReplDBMSHeader header)
Set the starting header. |
int |
size()
Returns the current queue size. |
void |
start()
Start the task thread. |
void |
stop()
Cancel the thread. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public THLParallelReadTask(int taskId,
THL thl,
Partitioner partitioner,
AtomicCounter headSeqnoCounter,
AtomicIntervalGuard<?> intervalGuard,
int maxSize,
int maxControlEvents,
int syncInterval,
com.continuent.tungsten.fsm.event.EventDispatcher dispatcher)
| Method Detail |
|---|
public void setRestartHeader(ReplDBMSHeader header)
public void prepare(PluginContext context)
throws ReplicatorException,
java.lang.InterruptedException
ReplicatorException
java.lang.InterruptedExceptionpublic void start()
public void stop()
public void release()
public void run()
run in interface java.lang.Runnablepublic int size()
public ReplEvent get()
throws java.lang.InterruptedException,
ReplicatorException
java.lang.InterruptedException - Thrown if method is interrupted
ReplicatorException - Thrown if the reader thread has failed
public ReplEvent peek()
throws java.lang.InterruptedException
java.lang.InterruptedException
public void putControlEvent(ReplControlEvent controlEvent)
throws java.lang.InterruptedException
java.lang.InterruptedException
public void addWatchSyncPredicate(WatchPredicate<ReplDBMSHeader> predicate)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||