DBZ-40 Misc. typo and formatting fixes

This commit is contained in:
Gunnar Morling 2018-07-24 13:09:52 +02:00
parent c001abccf2
commit 33f3d59078
7 changed files with 13 additions and 10 deletions

View File

@ -168,7 +168,7 @@ public static enum SnapshotMode implements EnumeratedValue {
INITIAL("initial", true),
/**
* Perform a snapshot of data and schema upon initial startup of a connector.
* Perform a snapshot of the schema but no data upon initial startup of a connector.
*/
INITIAL_SCHEMA_ONLY("initial_schema_only", false);

View File

@ -37,6 +37,7 @@ public class SourceInfo extends AbstractSourceInfo {
.build();
private final String serverName;
private Lsn changeLsn;
private Lsn commitLsn;
private boolean snapshot;
@ -81,7 +82,7 @@ public boolean isSnapshot() {
}
/**
* @param snapshot - true if the source of even is snapshot phase, nto the database log
* @param snapshot - true if the source of even is snapshot phase, not the database log
*/
public void setSnapshot(boolean snapshot) {
this.snapshot = snapshot;

View File

@ -17,6 +17,7 @@
* @author Jiri Pechanec
*/
public class SqlServerChangeRecordEmitter extends RelationalChangeRecordEmitter {
public static final int OP_DELETE = 1;
public static final int OP_INSERT = 2;
public static final int OP_UPDATE_BEFORE = 3;

View File

@ -16,6 +16,8 @@
import io.debezium.config.EnumeratedValue;
import io.debezium.config.Field;
import io.debezium.config.Field.ValidationOutput;
import io.debezium.connector.sqlserver.SqlServerConnectorConfig.SnapshotLockingMode;
import io.debezium.connector.sqlserver.SqlServerConnectorConfig.SnapshotMode;
import io.debezium.document.Document;
import io.debezium.heartbeat.Heartbeat;
import io.debezium.jdbc.JdbcConfiguration;
@ -30,7 +32,6 @@
* The list of configuration options for SQL Server connector
*
* @author Jiri Pechanec
*
*/
public class SqlServerConnectorConfig extends RelationalDatabaseConnectorConfig {
@ -45,7 +46,7 @@ public static enum SnapshotMode implements EnumeratedValue {
INITIAL("initial", true),
/**
* Perform a snapshot of data and schema upon initial startup of a connector.
* Perform a snapshot of the schema but no data upon initial startup of a connector.
*/
INITIAL_SCHEMA_ONLY("initial_schema_only", false);
@ -272,6 +273,7 @@ public String getDatabaseName() {
/**
* Returns a configured (but not yet started) instance of the database history.
*/
@Override
public DatabaseHistory getDatabaseHistory() {
Configuration config = getConfig();

View File

@ -69,7 +69,7 @@ public Set<TableId> getCapturedTables() {
return capturedTables;
}
private Set<TableId> determineCapturedTables(SqlServerConnectorConfig connectorConfig, SqlServerConnection connection) throws SQLException {
private static Set<TableId> determineCapturedTables(SqlServerConnectorConfig connectorConfig, SqlServerConnection connection) throws SQLException {
final Set<TableId> allTableIds = connection.readTableNames(connectorConfig.getDatabaseName(), null, null, new String[] {"TABLE"} );
final Set<TableId> capturedTables = new HashSet<>();

View File

@ -47,17 +47,17 @@ protected SnapshottingTask getSnapshottingTask(OffsetContext previousOffset) {
// found a previous offset and the earlier snapshot has completed
if (previousOffset != null && !previousOffset.isSnapshotRunning()) {
LOGGER.info("A previous offset indicating completed snapshot has been found. Neither schema nor data will be snapshotted.");
LOGGER.info("A previous offset indicating a completed snapshot has been found. Neither schema nor data will be snapshotted.");
snapshotSchema = false;
snapshotData = false;
}
else {
LOGGER.info("No previous offset has been found");
if (connectorConfig.getSnapshotMode().includeData()) {
LOGGER.info("Accroding to the connector configuration both schema and data will be snapshotted");
LOGGER.info("According to the connector configuration both schema and data will be snapshotted");
}
else {
LOGGER.info("Accroding to the connector configuration only schema will be snapshotted");
LOGGER.info("According to the connector configuration only schema will be snapshotted");
}
snapshotData = connectorConfig.getSnapshotMode().includeData();
}
@ -122,7 +122,7 @@ protected void readTableStructure(ChangeEventSourceContext sourceContext, Snapsh
throw new InterruptedException("Interrupted while reading structure of schema " + schema);
}
LOGGER.info("Reading sturcture of schema '{}'", snapshotContext.catalogName);
LOGGER.info("Reading stucture of schema '{}'", snapshotContext.catalogName);
jdbcConnection.readSchema(
snapshotContext.tables,
snapshotContext.catalogName,

View File

@ -215,5 +215,4 @@ public String toString() {
return "ChangeTable [tableId=" + tableId + ", resultSet=" + resultSet + ", completed=" + completed + "]";
}
}
}