Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NOJIRA] feat: refactor build script for multiproject #354

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ java {
withSourcesJar()
}

tasks.wrapper {
tasks.withType<Wrapper> {
doFirst {
val sha256Sum = URL("$distributionUrl.sha256").readText()
val sha256Sum = uri("$distributionUrl.sha256").toURL().readText()

propertiesFile.appendText("distributionSha256Sum=${sha256Sum}\n")
println("Added checksum to wrapper properties")
}
Expand All @@ -59,7 +60,7 @@ tasks.wrapper {

checkstyle {
toolVersion = "10.16.0"
configDirectory.set(rootProject.file("checkstyle/"))
configDirectory.set(project.projectDir.resolve("checkstyle/"))
}

jacoco {
Expand Down
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
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