Package io.debezium.connector.mysql
Enum MySqlConnectorConfig.SnapshotLockingMode
- java.lang.Object
-
- java.lang.Enum<MySqlConnectorConfig.SnapshotLockingMode>
-
- io.debezium.connector.mysql.MySqlConnectorConfig.SnapshotLockingMode
-
- All Implemented Interfaces:
EnumeratedValue
,Serializable
,Comparable<MySqlConnectorConfig.SnapshotLockingMode>
- Enclosing class:
- MySqlConnectorConfig
public static enum MySqlConnectorConfig.SnapshotLockingMode extends Enum<MySqlConnectorConfig.SnapshotLockingMode> implements EnumeratedValue
The set of predefined Snapshot Locking Mode options.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description EXTENDED
This mode will block all writes for the entire duration of the snapshot.MINIMAL
The connector holds the global read lock for just the initial portion of the snapshot while the connector reads the database schemas and other metadata.MINIMAL_PERCONA
The connector holds a (Percona-specific) backup lock for just the initial portion of the snapshot while the connector reads the database schemas and other metadata.NONE
This mode will avoid using ANY table locks during the snapshot process.
-
Constructor Summary
Constructors Modifier Constructor Description private
SnapshotLockingMode(String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
flushResetsIsolationLevel()
String
getLockStatement()
Determine which flavour of MySQL locking to use.String
getValue()
static MySqlConnectorConfig.SnapshotLockingMode
parse(String value)
Determine if the supplied value is one of the predefined options.static MySqlConnectorConfig.SnapshotLockingMode
parse(String value, String defaultValue)
Determine if the supplied value is one of the predefined options.boolean
usesLocking()
boolean
usesMinimalLocking()
static MySqlConnectorConfig.SnapshotLockingMode
valueOf(String name)
Returns the enum constant of this type with the specified name.static MySqlConnectorConfig.SnapshotLockingMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
EXTENDED
public static final MySqlConnectorConfig.SnapshotLockingMode EXTENDED
This mode will block all writes for the entire duration of the snapshot. Replaces deprecated configuration option snapshot.locking.minimal with a value of false.
-
MINIMAL
public static final MySqlConnectorConfig.SnapshotLockingMode MINIMAL
The connector holds the global read lock for just the initial portion of the snapshot while the connector reads the database schemas and other metadata. The remaining work in a snapshot involves selecting all rows from each table, and this can be done in a consistent fashion using the REPEATABLE READ transaction even when the global read lock is no longer held and while other MySQL clients are updating the database. Replaces deprecated configuration option snapshot.locking.minimal with a value of true.
-
MINIMAL_PERCONA
public static final MySqlConnectorConfig.SnapshotLockingMode MINIMAL_PERCONA
The connector holds a (Percona-specific) backup lock for just the initial portion of the snapshot while the connector reads the database schemas and other metadata. This lock will only block DDL and DML on non-transactional tables (MyISAM etc.). The remaining work in a snapshot involves selecting all rows from each table, and this can be done in a consistent fashion using the REPEATABLE READ transaction even when the global read lock is no longer held and while other MySQL clients are updating the database.
-
NONE
public static final MySqlConnectorConfig.SnapshotLockingMode NONE
This mode will avoid using ANY table locks during the snapshot process. This mode can only be used with SnapShotMode set to schema_only or schema_only_recovery.
-
-
Field Detail
-
value
private final String value
-
-
Constructor Detail
-
SnapshotLockingMode
private SnapshotLockingMode(String value)
-
-
Method Detail
-
values
public static MySqlConnectorConfig.SnapshotLockingMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (MySqlConnectorConfig.SnapshotLockingMode c : MySqlConnectorConfig.SnapshotLockingMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MySqlConnectorConfig.SnapshotLockingMode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getValue
public String getValue()
- Specified by:
getValue
in interfaceEnumeratedValue
-
usesMinimalLocking
public boolean usesMinimalLocking()
-
usesLocking
public boolean usesLocking()
-
flushResetsIsolationLevel
public boolean flushResetsIsolationLevel()
-
getLockStatement
public String getLockStatement()
Determine which flavour of MySQL locking to use.- Returns:
- the correct SQL to obtain a global lock for the current mode
-
parse
public static MySqlConnectorConfig.SnapshotLockingMode parse(String value)
Determine if the supplied value is one of the predefined options.- Parameters:
value
- the configuration property value; may not be null- Returns:
- the matching option, or null if no match is found
-
parse
public static MySqlConnectorConfig.SnapshotLockingMode parse(String value, String defaultValue)
Determine if the supplied value is one of the predefined options.- Parameters:
value
- the configuration property value; may not be nulldefaultValue
- the default value; may be null- Returns:
- the matching option, or null if no match is found and the non-null default is invalid
-
-