Skip to content

Commit

Permalink
quiet the debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstrickland committed Oct 28, 2024
1 parent 4da9591 commit f0b2eb3
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/aiven/connect/jdbc/sink/BufferedRecords.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ private void verifySuccessfulExecutions(final int totalSuccessfulExecutionCount,
}

if (successNoInfo) {
log.info("{} {} records:{} , but no count of the number of rows it affected is available",
log.debug("{} {} records:{} , but no count of the number of rows it affected is available",
config.insertMode,
recordType,
batchRecords.size()
Expand Down Expand Up @@ -296,13 +296,13 @@ private boolean isTombstone(final SinkRecord record) {
}

public void close() throws SQLException {
log.info("Closing BufferedRecords with preparedStatement: {}", preparedStatement);
log.debug("Closing BufferedRecords with preparedStatement: {}", preparedStatement);
if (preparedStatement != null) {
preparedStatement.close();
preparedStatement = null;
}

log.info("Closing BufferedRecords with deletePreparedStatement: {}", deletePreparedStatement);
log.debug("Closing BufferedRecords with deletePreparedStatement: {}", deletePreparedStatement);
if (deletePreparedStatement != null) {
deletePreparedStatement.close();
deletePreparedStatement = null;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/aiven/connect/jdbc/sink/DbStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void create(
);
}
final String sql = dbDialect.buildCreateTableStatement(tableId, fieldsMetadata.allFields.values());
log.info("Creating table with sql: {}", sql);
log.debug("Creating table with sql: {}", sql);
dbDialect.applyDdlStatements(connection, Collections.singletonList(sql));
}

Expand Down Expand Up @@ -159,7 +159,7 @@ boolean amendIfNecessary(
}

final List<String> amendTableQueries = dbDialect.buildAlterTable(tableId, missingFields);
log.info(
log.debug(
"Amending table to add missing fields:{} maxRetries:{} with SQL: {}",
missingFields,
maxRetries,
Expand Down Expand Up @@ -231,7 +231,7 @@ Set<SinkRecordField> missingFields(
}

if (missingFieldsIgnoreCase.size() > 0) {
log.info(
log.debug(
"Unable to find fields {} among column names {}",
missingFieldsIgnoreCase,
dbColumnNames
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/aiven/connect/jdbc/sink/JdbcDbWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class JdbcDbWriter {
this.cachedConnectionProvider = new CachedConnectionProvider(this.dbDialect) {
@Override
protected void onConnect(final Connection connection) throws SQLException {
log.info("JdbcDbWriter Connected");
log.debug("JdbcDbWriter Connected");
connection.setAutoCommit(false);
}
};
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/aiven/connect/jdbc/source/JdbcSourceTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public String version() {

@Override
public void start(final Map<String, String> properties) {
log.info("Starting JDBC source task");
log.debug("Starting JDBC source task");
try {
config = new JdbcSourceTaskConfig(properties);
config.validate();
Expand All @@ -100,7 +100,7 @@ public void start(final Map<String, String> properties) {
final String connectionUrl = config.getConnectionUrl();
dialect = DatabaseDialects.findBestFor(connectionUrl, config);
}
log.info("Using JDBC dialect {}", dialect.name());
log.debug("Using JDBC dialect {}", dialect.name());

cachedConnectionProvider = new SourceConnectionProvider(dialect, maxConnAttempts, retryBackoff);

Expand Down Expand Up @@ -253,7 +253,7 @@ public void start(final Map<String, String> properties) {
}

running.set(true);
log.info("Started JDBC source task");
log.debug("Started JDBC source task");
}

//This method returns a list of possible partition maps for different offset protocols
Expand All @@ -268,7 +268,7 @@ private List<Map<String, String>> possibleTablePartitions(final String table) {

@Override
public void stop() throws ConnectException {
log.info("Stopping JDBC source task");
log.debug("Stopping JDBC source task");
running.set(false);
// Wait for any in-progress polls to stop before closing resources
// On older versions of Kafka Connect, SourceTask::stop and SourceTask::poll may
Expand All @@ -281,7 +281,7 @@ public void stop() throws ConnectException {
}

protected void closeResources() {
log.info("Closing resources for JDBC source task");
log.debug("Closing resources for JDBC source task");
try {
if (cachedConnectionProvider != null) {
cachedConnectionProvider.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private synchronized boolean updateTables() {
}

if (!newTables.equals(this.tables)) {
log.info(
log.debug(
"After filtering the tables are: {}",
dialect.expressionBuilder()
.appendList()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private void newConnection() throws SQLException {
while (attempts < maxConnectionAttempts) {
try {
++count;
log.info("Attempting to open connection #{} to {}", count, provider);
log.debug("Attempting to open connection #{} to {}", count, provider);
connection = provider.getConnection();
onConnect(connection);
return;
Expand All @@ -113,7 +113,7 @@ private void newConnection() throws SQLException {
public synchronized void close() {
if (connection != null) {
try {
log.info("Closing connection #{} to {}", count, provider);
log.debug("Closing connection #{} to {}", count, provider);
connection.close();
} catch (final SQLException sqle) {
log.warn("Ignoring error closing connection", sqle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public TableDefinition get(
if (dialect.tableExists(connection, tableId)) {
dbTable = dialect.describeTable(connection, tableId);
if (dbTable != null) {
log.info("Setting metadata for table {} to {}", tableId, dbTable);
log.debug("Setting metadata for table {} to {}", tableId, dbTable);
cache.put(tableId, dbTable);
}
}
Expand All @@ -84,7 +84,7 @@ public TableDefinition refresh(
final TableId tableId
) throws SQLException {
final TableDefinition dbTable = dialect.describeTable(connection, tableId);
log.info("Refreshing metadata for table {} to {}", tableId, dbTable);
log.debug("Refreshing metadata for table {} to {}", tableId, dbTable);
cache.put(dbTable.id(), dbTable);
return dbTable;
}
Expand Down

0 comments on commit f0b2eb3

Please sign in to comment.