-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
modules/clickhouse: JDBC driver name changed, liveness port #5474
modules/clickhouse: JDBC driver name changed, liveness port #5474
Conversation
…some minor changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your contribution @anavrotski ! the PR looks good to me, just wondering if we can make it compatible with both drivers? wdyt @kiview @bsideup ?
this.withExposedPorts(HTTP_PORT, NATIVE_PORT); | ||
this.waitingFor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.withExposedPorts(HTTP_PORT, NATIVE_PORT); | |
this.waitingFor( | |
withExposedPorts(HTTP_PORT, NATIVE_PORT); | |
waitingFor( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I removed this.
- IntelliJ Idea shows me a warning: 'SELF'
used without 'try'-with-resources statement`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About support of both drivers - Clickhouse is now separate company, not part of Yandex. And when old driver is used:
2022-06-06T18:45:27.806+0900 WARN main ru.yandex.clickhouse.ClickHouseDriver ******************************************************************************************
2022-06-06T18:45:27.806+0900 WARN main ru.yandex.clickhouse.ClickHouseDriver * This driver is DEPRECATED. Please use [com.clickhouse.jdbc.ClickHouseDriver] instead. *
2022-06-06T18:45:27.807+0900 WARN main ru.yandex.clickhouse.ClickHouseDriver * Also everything in package [ru.yandex.clickhouse] will be removed starting from 0.4.0. *
2022-06-06T18:45:27.807+0900 WARN main ru.yandex.clickhouse.ClickHouseDriver ******************************************************************************************
So I think its usage should be avoided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it complained about this.
because the previous code for some reason did not pass a generic argument to JdbcDatabaseContainer
, this should fix it:
https://github.com/testcontainers/testcontainers-java/pull/5474/files#r892189020
modules/clickhouse/src/main/java/org/testcontainers/containers/ClickHouseContainer.java
Outdated
Show resolved
Hide resolved
modules/clickhouse/src/main/java/org/testcontainers/containers/ClickHouseContainer.java
Outdated
Show resolved
Hide resolved
modules/clickhouse/src/main/java/org/testcontainers/containers/ClickHouseProvider.java
Outdated
Show resolved
Hide resolved
@eddumelendez I do see a problem with dropping the support for an old driver, as this is a breaking change. |
In order to keep backward compatibility we can do something like this @Override
public String getDriverClassName() {
try {
Class.forName("ru.yandex.clickhouse.ClickHouseDriver");
return "ru.yandex.clickhouse.ClickHouseDriver";
} catch (ClassNotFoundException e) {
return "com.clickhouse.jdbc.ClickHouseDriver";
}
} |
Why not try to load the new driver class first, and fall back to the old one if failed? |
@anavrotski by any chance do you have some time to work on the changes? Thanks in advance. |
…/ClickHouseContainer.java Co-authored-by: Sergei Egorov <bsideup@gmail.com>
…/ClickHouseContainer.java Co-authored-by: Sergei Egorov <bsideup@gmail.com>
ru.yandex.clickhouse
(deprected) tocom.clickhouse
ClickHouseContainer
extends class with generic type (JdbcDatabaseContainer
) I think it should extend it in same way asMySQLContainer
orPostgreSQLContainer
etc.getLivenessCheckPortNumbers
changed to be the same as in containers mentioned above.