com.continuent.tungsten.replicator.thl.log
Class LogFlushTask

java.lang.Object
  extended by com.continuent.tungsten.replicator.thl.log.LogFlushTask
All Implemented Interfaces:
java.lang.Runnable

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

This class implements a task to issue asynchronous flush calls on active log files.

Important concurrency note: This class calls back into LogFile instances, which in turn call this class to register themselves. Methods on this class should *not* be synchronized as this would create the possibility of deadlock. Synchronization within this class is handled by the ConncurrentHashMap that contains the log files.

Version:
1.0
Author:
Robert Hodges

Constructor Summary
LogFlushTask(long flushIntervalMillis)
          Creates a new log sync task.
 
Method Summary
 void addLogFile(LogFile logFile)
          Adds a logFile to the list for regular synchronization.
 void cancel()
          Signal that the task should end.
 boolean isFinished()
          Returns true if the task has completed.
 void removeLogFile(LogFile logFile)
          Removes a logfile from the list.
 void run()
          Extracts from the relay log until cancelled or we fail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFlushTask

public LogFlushTask(long flushIntervalMillis)
Creates a new log sync task.

Method Detail

run

public void run()
Extracts from the relay log until cancelled or we fail.

Specified by:
run in interface java.lang.Runnable

addLogFile

public void addLogFile(LogFile logFile)
Adds a logFile to the list for regular synchronization.

Parameters:
logFile -

removeLogFile

public void removeLogFile(LogFile logFile)
Removes a logfile from the list.

Parameters:
logFile -

cancel

public void cancel()
Signal that the task should end.


isFinished

public boolean isFinished()
Returns true if the task has completed.