com.continuent.tungsten.replicator.extractor.mysql
Class RelayLogPosition

java.lang.Object
  extended by com.continuent.tungsten.replicator.extractor.mysql.RelayLogPosition

public class RelayLogPosition
extends java.lang.Object

Simple class to track the relay log position using synchronized methods to ensure the file and offset are always updated consistently.

Author:
Robert Hodges

Field Summary
protected  java.io.File curFile
           
protected  long curOffset
           
 
Constructor Summary
RelayLogPosition()
           
 
Method Summary
 RelayLogPosition clone()
          Return a consistent clone of this position.
 java.io.File getFile()
           
 long getOffset()
           
 boolean hasReached(java.lang.String fileName, long offset)
          Return true if we have reached a desired file:offset position.
 void setOffset(int offset)
           
 void setPosition(java.io.File file, long offset)
           
 java.lang.String toString()
          Return a string representation of the position.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

curFile

protected java.io.File curFile

curOffset

protected long curOffset
Constructor Detail

RelayLogPosition

public RelayLogPosition()
Method Detail

setPosition

public void setPosition(java.io.File file,
                        long offset)

setOffset

public void setOffset(int offset)

getFile

public java.io.File getFile()

getOffset

public long getOffset()

clone

public RelayLogPosition clone()
Return a consistent clone of this position.

Overrides:
clone in class java.lang.Object

hasReached

public boolean hasReached(java.lang.String fileName,
                          long offset)
Return true if we have reached a desired file:offset position.


toString

public java.lang.String toString()
Return a string representation of the position.

Overrides:
toString in class java.lang.Object