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

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

public class BinlogIndex
extends java.lang.Object

Reads and lists binlog files in the binlog index

Version:
1.0
Author:
Robert Hodges

Constructor Summary
BinlogIndex(java.lang.String directory, java.lang.String baseName, boolean readIndex)
          Creates a new BinlogIndex instance.
 
Method Summary
 java.util.List<java.io.File> getBinlogFiles()
          Returns the current list of binlog files.
 java.io.File nextBinlog(java.lang.String binlogName)
          Return the next binlog file following the named file.
 void readIndex()
          Refreshes the list of binlog files from current index contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinlogIndex

public BinlogIndex(java.lang.String directory,
                   java.lang.String baseName,
                   boolean readIndex)
            throws ReplicatorException
Creates a new BinlogIndex instance.

Parameters:
directory - Binlog directory
baseName - Binlog base name pattern
readIndex - If true, read the index immediately
Throws:
ReplicatorException - Throw if there is any kind of error
Method Detail

readIndex

public void readIndex()
               throws ReplicatorException
Refreshes the list of binlog files from current index contents.

Throws:
ReplicatorException - Thrown if there is an error when reading the file

nextBinlog

public java.io.File nextBinlog(java.lang.String binlogName)
Return the next binlog file following the named file. Return null if the filename either cannot be found or is the last file in the list.

Parameters:
binlogName - Basename of binlog file, e.g., mysql-bin.000023.
Returns:
Next binlog file or null if not found

getBinlogFiles

public java.util.List<java.io.File> getBinlogFiles()
Returns the current list of binlog files.