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 void
checkTables
(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 boolean
static void
dumpDatabase
(Database md, AoservDaemonProtocol.Version protocolVersion, StreamableOutput masterOut, boolean gzip) static String
getJdbcUrl
(Port port, Database.Name database) static void
getMasterStatus
(int mysqlServer, StreamableOutput out) static Connection
getMysqlConnection
(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port) Gets a connection to the MySQL server, this handles both master and slave scenarios.static void
getSlaveStatus
(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, StreamableOutput out) static void
getTableStatus
(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, StreamableOutput out) static void
start()
static void
Methods 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:
doRebuild
in classBuilderThread
- Returns:
true
if successful orfalse
if unsuccessful and needs to be retried.
-
dumpDatabase
public static void dumpDatabase(Database md, AoservDaemonProtocol.Version protocolVersion, StreamableOutput masterOut, boolean gzip) throws IOException, SQLException - Throws:
IOException
SQLException
-
start
- Throws:
IOException
SQLException
-
waitForRebuild
public static void waitForRebuild() -
getProcessTimerDescription
- Specified by:
getProcessTimerDescription
in classBuilderThread
-
getMasterStatus
public static void getMasterStatus(int mysqlServer, StreamableOutput out) throws IOException, SQLException - Throws:
IOException
SQLException
-
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:
IOException
SQLException
-
getSlaveStatus
public static void getSlaveStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, StreamableOutput out) throws IOException, SQLException - Throws:
IOException
SQLException
-
getTableStatus
public static void getTableStatus(PosixPath failoverRoot, int nestedOperatingSystemVersion, Server.Name serverName, Port port, Database.Name databaseName, StreamableOutput out) throws IOException, SQLException - Throws:
IOException
SQLException
-
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:
IOException
SQLException
-