com.continuent.tungsten.replicator.backup.mysql
Class MySqlLvmDumpAgent

java.lang.Object
  extended by com.continuent.tungsten.replicator.backup.AbstractBackupAgent
      extended by com.continuent.tungsten.replicator.backup.mysql.MySqlLvmDumpAgent
All Implemented Interfaces:
BackupAgent, BackupPlugin

public class MySqlLvmDumpAgent
extends AbstractBackupAgent

Implements a backup agent that works using mysqldump to dump data and mysql to restore.

Version:
1.0
Author:
Robert Hodges

Field Summary
 
Fields inherited from class com.continuent.tungsten.replicator.backup.AbstractBackupAgent
capabilities, restoreCompleted
 
Constructor Summary
MySqlLvmDumpAgent()
           
 
Method Summary
 BackupSpecification backup()
          Runs backup using LVM snapshot.
protected  void completeRestore()
          Post-restore operations.
 void configure()
          Complete plug-in configuration.
 java.lang.String getCommandPrefix()
           
 java.lang.String getDataDir()
           
 java.lang.String getDumpDir()
           
 java.lang.String getHost()
           
 java.lang.String getLogicalVolume()
           
 java.lang.String getLogicalVolumeMount()
           
 java.lang.String getLvcreate()
           
 java.lang.String getLvremove()
           
 java.lang.String getMysqlStart()
           
 java.lang.String getMysqlStop()
           
 java.lang.String getPassword()
           
 int getPort()
           
 java.lang.String getSnapshotMount()
           
 java.lang.String getSnapshotName()
           
 java.lang.String getSnapshotSize()
           
 java.lang.String getUser()
           
 java.lang.String getVolumeGroup()
           
protected  void initRestore()
          Pre-restore operations.
 void release()
          Release all resources used by plug-in.
protected  void restoreOneLocator(BackupLocator locator)
          restoreOneLocator is used to restore a database using one locator.
 void setCommandPrefix(java.lang.String commandPrefix)
           
 void setDataDir(java.lang.String dataDir)
           
 void setDumpDir(java.lang.String dumpDir)
           
 void setHost(java.lang.String host)
           
 void setLogicalVolume(java.lang.String logicalVolume)
           
 void setLogicalVolumeMount(java.lang.String logicalVolumeMount)
           
 void setLvcreate(java.lang.String lvcreate)
           
 void setLvremove(java.lang.String lvremove)
           
 void setMysqlStart(java.lang.String mysqlStart)
           
 void setMysqlStop(java.lang.String mysqlStop)
           
 void setPassword(java.lang.String password)
           
 void setPort(int port)
           
 void setSnapshotMount(java.lang.String snapshotMount)
           
 void setSnapshotName(java.lang.String snapshotName)
           
 void setSnapshotSize(java.lang.String snapshotSize)
           
 void setUser(java.lang.String user)
           
 void setVolumeGroup(java.lang.String volumeGroup)
           
 
Methods inherited from class com.continuent.tungsten.replicator.backup.AbstractBackupAgent
capabilities, restore
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySqlLvmDumpAgent

public MySqlLvmDumpAgent()
Method Detail

getHost

public java.lang.String getHost()

setHost

public void setHost(java.lang.String host)

getPort

public int getPort()

setPort

public void setPort(int port)

getUser

public java.lang.String getUser()

setUser

public void setUser(java.lang.String user)

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

getVolumeGroup

public java.lang.String getVolumeGroup()

setVolumeGroup

public void setVolumeGroup(java.lang.String volumeGroup)

getLogicalVolume

public java.lang.String getLogicalVolume()

setLogicalVolume

public void setLogicalVolume(java.lang.String logicalVolume)

getLogicalVolumeMount

public java.lang.String getLogicalVolumeMount()

setLogicalVolumeMount

public void setLogicalVolumeMount(java.lang.String logicalVolumeMount)

getDataDir

public java.lang.String getDataDir()

setDataDir

public void setDataDir(java.lang.String dataDir)

getSnapshotName

public java.lang.String getSnapshotName()

setSnapshotName

public void setSnapshotName(java.lang.String snapshotName)

getSnapshotSize

public java.lang.String getSnapshotSize()

setSnapshotSize

public void setSnapshotSize(java.lang.String snapshotSize)

getSnapshotMount

public java.lang.String getSnapshotMount()

setSnapshotMount

public void setSnapshotMount(java.lang.String snapshotMount)

getDumpDir

public java.lang.String getDumpDir()

setDumpDir

public void setDumpDir(java.lang.String dumpDir)

getCommandPrefix

public java.lang.String getCommandPrefix()

setCommandPrefix

public void setCommandPrefix(java.lang.String commandPrefix)

getMysqlStart

public java.lang.String getMysqlStart()

setMysqlStart

public void setMysqlStart(java.lang.String mysqlStart)

getMysqlStop

public java.lang.String getMysqlStop()

setMysqlStop

public void setMysqlStop(java.lang.String mysqlStop)

getLvcreate

public java.lang.String getLvcreate()

setLvcreate

public void setLvcreate(java.lang.String lvcreate)

getLvremove

public java.lang.String getLvremove()

setLvremove

public void setLvremove(java.lang.String lvremove)

backup

public BackupSpecification backup()
                           throws BackupException
Runs backup using LVM snapshot. Back up the database.

Specified by:
backup in interface BackupAgent
Specified by:
backup in class AbstractBackupAgent
Throws:
BackupException
See Also:
BackupAgent.backup()

restoreOneLocator

protected void restoreOneLocator(BackupLocator locator)
                          throws BackupException,
                                 java.io.FileNotFoundException
Description copied from class: AbstractBackupAgent
restoreOneLocator is used to restore a database using one locator.

Specified by:
restoreOneLocator in class AbstractBackupAgent
Parameters:
locator - the locator to be used to restore the database
Throws:
BackupException - if something happens while restoring
java.io.FileNotFoundException - if the dump file cannot be found

initRestore

protected void initRestore()
                    throws BackupException
Description copied from class: AbstractBackupAgent
Pre-restore operations.

Overrides:
initRestore in class AbstractBackupAgent
Throws:
BackupException - if anything wrong happened while preparing to restore

completeRestore

protected void completeRestore()
Description copied from class: AbstractBackupAgent
Post-restore operations.

Overrides:
completeRestore in class AbstractBackupAgent

configure

public void configure()
               throws BackupException
Complete plug-in configuration. This is called after setters are invoked.

Specified by:
configure in interface BackupPlugin
Overrides:
configure in class AbstractBackupAgent
Throws:
BackupException
See Also:
BackupPlugin.configure()

release

public void release()
             throws BackupException
Release all resources used by plug-in. This is called before the plug-in is deallocated.

Specified by:
release in interface BackupPlugin
Specified by:
release in class AbstractBackupAgent
Throws:
BackupException
See Also:
BackupPlugin.release()