Package com.zendesk.maxwell
Class MaxwellMysqlStatus
- java.lang.Object
-
- com.zendesk.maxwell.MaxwellMysqlStatus
-
public class MaxwellMysqlStatus extends Object
Class with some utility functions for querying mysql server state
-
-
Constructor Summary
Constructors Constructor Description MaxwellMysqlStatus(Connection c)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CaseSensitivity
captureCaseSensitivity(Connection c)
Return an enum representing the current case sensitivity of the serverstatic void
ensureGtidMysqlState(Connection c)
Verify that we can safely turn on maxwell GTID modestatic void
ensureMaxwellMysqlState(Connection c)
Verify that the maxwell database is in the expected statestatic void
ensureReplicationMysqlState(Connection c)
Verify that replication is in the expected state: Check that a serverID is set check that binary logging is on Check that the binlog_format is "ROW" Warn if binlog_row_image is MINIMALString
getVariableState(String variableName)
String
getVariableState(String variableName, boolean throwOnMissing)
boolean
isMaria()
static boolean
isMaria(Connection c)
-
-
-
Constructor Detail
-
MaxwellMysqlStatus
public MaxwellMysqlStatus(Connection c)
-
-
Method Detail
-
isMaria
public boolean isMaria()
-
getVariableState
public String getVariableState(String variableName, boolean throwOnMissing) throws SQLException, MaxwellCompatibilityError
-
getVariableState
public String getVariableState(String variableName) throws SQLException
- Throws:
SQLException
-
ensureReplicationMysqlState
public static void ensureReplicationMysqlState(Connection c) throws SQLException, MaxwellCompatibilityError
Verify that replication is in the expected state:- Check that a serverID is set
- check that binary logging is on
- Check that the binlog_format is "ROW"
- Warn if binlog_row_image is MINIMAL
- Parameters:
c
- a JDBC connection- Throws:
SQLException
- if the database has issuesMaxwellCompatibilityError
- if we are not in the expected state
-
ensureMaxwellMysqlState
public static void ensureMaxwellMysqlState(Connection c) throws SQLException, MaxwellCompatibilityError
Verify that the maxwell database is in the expected state- Parameters:
c
- a JDBC connection- Throws:
SQLException
- if we have database issuesMaxwellCompatibilityError
- if we're not in the expected state
-
ensureGtidMysqlState
public static void ensureGtidMysqlState(Connection c) throws SQLException, MaxwellCompatibilityError
Verify that we can safely turn on maxwell GTID mode- Parameters:
c
- a JDBC connection- Throws:
SQLException
- if we have db troublesMaxwellCompatibilityError
- if we're not in the expected state
-
isMaria
public static boolean isMaria(Connection c)
-
captureCaseSensitivity
public static CaseSensitivity captureCaseSensitivity(Connection c) throws SQLException
Return an enum representing the current case sensitivity of the server- Parameters:
c
- a JDBC connection- Returns:
- case sensitivity
- Throws:
SQLException
- if we have db troubles
-
-