Class MySQLDatabaseManager
java.lang.Object
com.aoindustries.aoserv.daemon.util.BuilderThread
com.aoindustries.aoserv.daemon.mysql.MySQLDatabaseManager
- All Implemented Interfaces:
TableListener,PackageManager.PackageListener
Controls the MySQL databases.
- Author:
- AO Industries, Inc.
-
Field Summary
Fields inherited from class com.aoindustries.aoserv.daemon.util.BuilderThread
DEFAULT_MAXIMUM_DELAY, DEFAULT_MINIMUM_DELAY, DEFAULT_PROCESS_TIMER_MAXIMUM_TIME, DEFAULT_PROCESS_TIMER_REMINDER_INTERVAL -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckTables(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, List<TableName> tableNames, StreamableOutput out) Checks all tables, times-out in one minute.protected booleanstatic voiddumpDatabase(Database md, AoservDaemonProtocol.Version protocolVersion, StreamableOutput masterOut, boolean gzip) static StringgetJdbcUrl(Port port, Database.Name database) static voidgetMasterStatus(int mysqlServer, StreamableOutput out) static ConnectiongetMysqlConnection(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port) Gets a connection to the MySQL server, this handles both master and slave scenarios.static voidgetSlaveStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, StreamableOutput out) static voidgetTableStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, StreamableOutput out) static voidstart()static voidMethods inherited from class com.aoindustries.aoserv.daemon.util.BuilderThread
getMaximumDelay, getMinimumDelay, getProcessTimerMaximumTime, getProcessTimerReminderInterval, getProcessTimerSubject, getRandomDelay, packageListUpdated, tableUpdated, waitForBuild
-
Method Details
-
doRebuild
protected boolean doRebuild()- Specified by:
doRebuildin classBuilderThread- Returns:
trueif successful orfalseif unsuccessful and needs to be retried.
-
dumpDatabase
public static void dumpDatabase(Database md, AoservDaemonProtocol.Version protocolVersion, StreamableOutput masterOut, boolean gzip) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
start
- Throws:
IOExceptionSQLException
-
waitForRebuild
public static void waitForRebuild() -
getProcessTimerDescription
- Specified by:
getProcessTimerDescriptionin classBuilderThread
-
getMasterStatus
public static void getMasterStatus(int mysqlServer, StreamableOutput out) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getJdbcUrl
-
getMysqlConnection
public static Connection getMysqlConnection(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port) throws IOException, SQLException Gets a connection to the MySQL server, this handles both master and slave scenarios.- Throws:
IOExceptionSQLException
-
getSlaveStatus
public static void getSlaveStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, StreamableOutput out) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
getTableStatus
public static void getTableStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, StreamableOutput out) throws IOException, SQLException - Throws:
IOExceptionSQLException
-
checkTables
public static void checkTables(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, List<TableName> tableNames, StreamableOutput out) throws IOException, SQLException Checks all tables, times-out in one minute.- Throws:
IOExceptionSQLException
-
