net.sf.farrago.syslib
Class FarragoSystemBackup

java.lang.Object
  extended by net.sf.farrago.syslib.FarragoSystemBackup

public class FarragoSystemBackup
extends Object

FarragoSystemBackup implements hot backup of the Farrago catalog and Fennel data, provided Fennel supports versioning. Full, incremental, and differential backups are supported, and the backup files can be optionally compressed.

Version:
$Id: //open/dev/farrago/src/net/sf/farrago/syslib/FarragoSystemBackup.java#5 $
Author:
Zelaine Fong

Field Summary
private  String archiveDirectory
           
private  String backupType
           
private  boolean checkSpace
           
private  String compressionMode
           
(package private)  Long dbSize
           
private  FennelDbHandle fennelDbHandle
           
private  boolean isCompressed
           
(package private)  Long lowerBoundCsn
           
private  long padding
           
private  FarragoRepos repos
           
private  FarragoReposTxnContext reposTxnContext
           
private  FarragoRepos systemRepos
           
private  EigenbaseTimingTracer timingTracer
           
private static Logger tracer
           
private  FarragoBackupType type
           
(package private)  Long upperBoundCsn
           
 
Constructor Summary
FarragoSystemBackup(String archiveDirectory, String backupType, String compressionMode, boolean checkSpace, long padding)
           
 
Method Summary
 void backupDatabase()
          Backs up the database.
private  long getLowerBoundCsn(FarragoBackupType backupType, List<FarragoCatalogUtil.BackupData> backupData)
          Determines the lower bound csn for the current backup based on the type of the backup and previous backup data.
private  void initiateBackup(FennelExecutionHandle execHandle)
          Executes the initial portion of the backup, which includes backing up Fennel metadata pages and the Farrago catalog.
private  void writeBackupPropertyFile(String archiveDirectory, String backupType, String compressionMode, String dbSize, String lowerBoundCsn, String upperBoundCsn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tracer

private static final Logger tracer

archiveDirectory

private String archiveDirectory

backupType

private String backupType

compressionMode

private String compressionMode

checkSpace

private boolean checkSpace

padding

private long padding

reposTxnContext

private FarragoReposTxnContext reposTxnContext

repos

private FarragoRepos repos

type

private FarragoBackupType type

systemRepos

private FarragoRepos systemRepos

fennelDbHandle

private FennelDbHandle fennelDbHandle

isCompressed

private boolean isCompressed

lowerBoundCsn

Long lowerBoundCsn

upperBoundCsn

Long upperBoundCsn

dbSize

Long dbSize

timingTracer

private EigenbaseTimingTracer timingTracer
Constructor Detail

FarragoSystemBackup

public FarragoSystemBackup(String archiveDirectory,
                           String backupType,
                           String compressionMode,
                           boolean checkSpace,
                           long padding)
Method Detail

backupDatabase

public void backupDatabase()
                    throws Exception
Backs up the database.

Throws:
Exception

initiateBackup

private void initiateBackup(FennelExecutionHandle execHandle)
                     throws Exception
Executes the initial portion of the backup, which includes backing up Fennel metadata pages and the Farrago catalog. During this portion of the backup, the catalog is locked.

Parameters:
execHandle - execution handle to associate with the Fennel command
Throws:
Exception

writeBackupPropertyFile

private void writeBackupPropertyFile(String archiveDirectory,
                                     String backupType,
                                     String compressionMode,
                                     String dbSize,
                                     String lowerBoundCsn,
                                     String upperBoundCsn)
                              throws Exception
Throws:
Exception

getLowerBoundCsn

private long getLowerBoundCsn(FarragoBackupType backupType,
                              List<FarragoCatalogUtil.BackupData> backupData)
Determines the lower bound csn for the current backup based on the type of the backup and previous backup data.

Parameters:
backupType - the type of the current backup
backupData - information on backups completed
Returns:
the lower bound csn of the current backup