com.oy.shared.lw.samples.mysqlrepl.impl
Class MySqlReplCmd
java.lang.Object
com.oy.shared.lw.samples.mysqlrepl.impl.MySqlReplCmd
- public class MySqlReplCmd
- extends java.lang.Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
formatter
private static final java.text.NumberFormat formatter
SHOW_MASTER_STATUS_FILE
final java.lang.String SHOW_MASTER_STATUS_FILE
- See Also:
- Constant Field Values
SHOW_SLAVE_STATUS_MASTER_LOG_FILE
final java.lang.String SHOW_SLAVE_STATUS_MASTER_LOG_FILE
- See Also:
- Constant Field Values
SHOW_MASTER_LOGS_LOG_NAME
final java.lang.String SHOW_MASTER_LOGS_LOG_NAME
- See Also:
- Constant Field Values
SHOW_VARIABLE_VALUE
final java.lang.String SHOW_VARIABLE_VALUE
- See Also:
- Constant Field Values
trace
private ITrace trace
ctx
private MySqlReplContext ctx
MySqlReplCmd
public MySqlReplCmd(ITrace trace,
MySqlReplContext ctx)
initMaster
public boolean initMaster()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
incMasterStatus
public MySqlReplDbStatus incMasterStatus(java.sql.Connection toMaster,
int uid)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getSlaveStatus
public MySqlReplDbStatus getSlaveStatus(java.sql.Connection toSlave,
int uid)
throws java.sql.SQLException,
ESlaveStateException
- Throws:
java.sql.SQLException
ESlaveStateException
isValidMasterBinLog
private boolean isValidMasterBinLog(java.sql.Connection toMaster,
java.lang.String name)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
purgeBinLogs
public void purgeBinLogs(java.sql.Connection toMaster,
MySqlReplDbStatus slaveStatus,
MySqlReplStatusMonitor monitor)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
execUpdate
private int execUpdate(java.sql.Connection conn,
java.lang.String sql)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
releaseToSlave
public void releaseToSlave(java.sql.Connection conn)
releaseToMaster
public void releaseToMaster(java.sql.Connection conn)
releaseToRoot
public void releaseToRoot(java.sql.Connection conn)
borrowNewToSlave
public java.sql.Connection borrowNewToSlave()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
borrowNewToMaster
public java.sql.Connection borrowNewToMaster()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
borrowNewToRoot
private java.sql.Connection borrowNewToRoot()
throws java.sql.SQLException
- Throws:
java.sql.SQLException
getBinLogFileIndex
private static int getBinLogFileIndex(java.lang.String fileName)
getBinLogFileNameBase
private static java.lang.String getBinLogFileNameBase(java.lang.String fileName)
formatBinLogFileName
private java.lang.String formatBinLogFileName(int idx,
java.lang.String baseName)
newPreparedStatement
private java.sql.PreparedStatement newPreparedStatement(java.sql.Connection conn,
java.lang.String text)
throws java.sql.SQLException
- Throws:
java.sql.SQLException
Copyright (C) 2005-2006 Pavel Simakov
http://www.softwaresecretweapons.com