DBZ-947 Formatting
This commit is contained in:
parent
64c45c7490
commit
a27c29765a
@ -109,7 +109,7 @@ public static SnapshotMode parse(String value, String defaultValue) {
|
||||
}
|
||||
|
||||
/**
|
||||
* The set of predefined Snapshot Isolation Mode options.
|
||||
* The set of predefined snapshot isolation mode options.
|
||||
*/
|
||||
public static enum SnapshotIsolationMode implements EnumeratedValue {
|
||||
|
||||
@ -121,13 +121,13 @@ public static enum SnapshotIsolationMode implements EnumeratedValue {
|
||||
EXCLUSIVE("exclusive"),
|
||||
|
||||
/**
|
||||
* This mode uses SNAPSHOT isolation level. This way reads and writes are not blocked for the entire duration
|
||||
* This mode uses SNAPSHOT isolation level. This way reads and writes are not blocked for the entire duration
|
||||
* of the snapshot. Snapshot consistency is guaranteed as long as DDL statements are not executed at the time.
|
||||
*/
|
||||
SNAPSHOT("snapshot"),
|
||||
|
||||
/**
|
||||
* This mode uses REPEATABLE READ isolation level. This mode will avoid taking any table
|
||||
* This mode uses REPEATABLE READ isolation level. This mode will avoid taking any table
|
||||
* locks during the snapshot process, except schema snapshot phase where exclusive table
|
||||
* locks are acquired for a short period. Since phantom reads can occur, it does not fully
|
||||
* guarantee consistency.
|
||||
@ -135,7 +135,7 @@ public static enum SnapshotIsolationMode implements EnumeratedValue {
|
||||
REPEATABLE_READ("repeatable_read"),
|
||||
|
||||
/**
|
||||
* This mode uses READ UNCOMMITTED isolation level. This mode takes neither table locks nor row-level locks
|
||||
* This mode uses READ UNCOMMITTED isolation level. This mode takes neither table locks nor row-level locks
|
||||
* during the snapshot process. This way other transactions are not affected by initial snapshot process.
|
||||
* However, snapshot consistency is not guaranteed.
|
||||
*/
|
||||
|
@ -186,7 +186,8 @@ protected SchemaChangeEvent getCreateTableEvent(SnapshotContext snapshotContext,
|
||||
protected void complete(SnapshotContext snapshotContext) {
|
||||
try {
|
||||
jdbcConnection.connection().setTransactionIsolation(((SqlServerSnapshotContext)snapshotContext).isolationLevelBeforeStart);
|
||||
} catch (SQLException e) {
|
||||
}
|
||||
catch (SQLException e) {
|
||||
throw new RuntimeException("Failed to set transaction isolation level.", e);
|
||||
}
|
||||
}
|
||||
|
@ -92,10 +92,12 @@ public SnapshotResult execute(ChangeEventSourceContext context) throws Interrupt
|
||||
final SnapshotContext ctx;
|
||||
try {
|
||||
ctx = prepare(context);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
catch (Exception e) {
|
||||
LOGGER.error("Failed to initialize snapshot context.", e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
try {
|
||||
LOGGER.info("Snapshot step 1 - Preparing");
|
||||
snapshotProgressListener.snapshotStarted();
|
||||
|
Loading…
Reference in New Issue
Block a user