clickhouse-java icon indicating copy to clipboard operation
clickhouse-java copied to clipboard

r2dbc module is added.

Open rernas35 opened this issue 2 years ago • 13 comments

rernas35 avatar May 02 '22 09:05 rernas35

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 02 '22 09:05 CLAassistant

Benchmark                                (client)  (connection)  (statement)  (type)   Mode  Cnt     Score    Error  Units
Basic.insertOneRandomNumber  clickhouse-http-jdbc         reuse       normal  object  thrpt   20   261.588 ± 24.470  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc         reuse     prepared  object  thrpt   20   246.439 ± 30.610  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc           new       normal  object  thrpt   20   269.055 ± 25.420  ops/s
Basic.insertOneRandomNumber  clickhouse-http-jdbc           new     prepared  object  thrpt   20   249.802 ± 22.271  ops/s
Basic.insertOneRandomNumber  clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   271.438 ± 37.502  ops/s
Basic.insertOneRandomNumber  clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   240.271 ± 20.264  ops/s
Basic.insertOneRandomNumber  clickhouse-grpc-jdbc           new       normal  object  thrpt   20   271.611 ± 38.994  ops/s
Basic.insertOneRandomNumber  clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   228.747 ± 32.263  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc         reuse       normal  object  thrpt   20  1045.156 ± 75.673  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc         reuse     prepared  object  thrpt   20  1078.172 ± 86.075  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc           new       normal  object  thrpt   20  1112.164 ± 90.219  ops/s
Basic.selectOneRandomNumber  clickhouse-http-jdbc           new     prepared  object  thrpt   20  1133.879 ± 92.128  ops/s
Basic.selectOneRandomNumber  clickhouse-grpc-jdbc         reuse       normal  object  thrpt   20   929.353 ± 50.465  ops/s
Basic.selectOneRandomNumber  clickhouse-grpc-jdbc         reuse     prepared  object  thrpt   20   941.641 ± 42.785  ops/s
Basic.selectOneRandomNumber  clickhouse-grpc-jdbc           new       normal  object  thrpt   20   919.707 ± 77.469  ops/s
Basic.selectOneRandomNumber  clickhouse-grpc-jdbc           new     prepared  object  thrpt   20   921.545 ± 74.374  ops/s

github-actions[bot] avatar May 02 '22 09:05 github-actions[bot]

Thank you @rernas35! Just some immediate feedback:

  1. Is JDK 11 a hard requirement? Can we stay on JDK 8?
  2. Least dependency - can we remove optional dependencies like lombok and slf4j? com.clickhouse.client.logging.Logger can be used for logging - it falls back to java util logging when slf4j is not available.
  3. Can we merge clickhouse-r2dbc-runtime-test into clickhouse-r2dbc?
  4. Bump R2DBC to 1.0.0.RELEASE? - see R2DBC 1.0 goes GA

There're some other minor issues in pom files but once you fixed build break and tidy up code, I can follow up to address them.

zhicwu avatar May 02 '22 09:05 zhicwu

Is the failure of the CI/CD expected behavior or does it mean that the PR has not yet completed? Is there any unfinished business?

linghengqian avatar Jun 13 '22 05:06 linghengqian

Is the failure of the CI/CD expected behavior or does it mean that the PR has not yet completed? Is there any unfinished business?

can you please approve the workflows

rernas35 avatar Jun 13 '22 18:06 rernas35

Is the failure of the CI/CD expected behavior or does it mean that the PR has not yet completed? Is there any unfinished business?

builds fixed

rernas35 avatar Jun 14 '22 10:06 rernas35

@rernas35 i see this pr is still pending can you explain shorty what is the purpose of the new module

mzitnik avatar Jun 25 '22 19:06 mzitnik

@rernas35 i see this pr is still pending can you explain shorty what is the purpose of the new module

this is r2dbc module which is compliant with r2dbc specs (https://r2dbc.io/). I need to add a sample and readme then it is ready for review

rernas35 avatar Jun 25 '22 22:06 rernas35

Hi @rernas35, it looks like the test never ran. The build success only proves that r2dbc module can be compiled without issue. I think it's better to enable tests and merge it into 0.3.3 release.

zhicwu avatar Jun 26 '22 14:06 zhicwu

@rernas35, please use ClickHouseNodes.of(uri) to get list of servers to connect to, since load balancing and failover are now supported(details at here). Please pay attention to failover, it's implemented by a wrapper around ClickHouseClient - see implementation at here. If you don't want the wrapper, you have to explicitly disable agent when build ClickHouseClient, for example: ClickHouseClient.builder().agent(false)...build().

zhicwu avatar Jun 27 '22 00:06 zhicwu

@rernas35, please use ClickHouseNodes.of(uri) to get list of servers to connect to, since load balancing and failover are now supported(details at here). Please pay attention to failover, it's implemented by a wrapper around ClickHouseClient - see implementation at here. If you don't want the wrapper, you have to explicitly disable agent when build ClickHouseClient, for example: ClickHouseClient.builder().agent(false)...build().

@zhicwu I have done some tests but it looks like r2dbc url is not supporting multiple hosts currently.

here

Since currently fragment part of r2dbc url is not supported, tags are not supported but other parameters are all passed and ClickHouseNodes is being used.

rernas35 avatar Jul 17 '22 11:07 rernas35

@rernas35 i see this pr is still pending can you explain shorty what is the purpose of the new module

this is r2dbc module which is compliant with r2dbc specs (https://r2dbc.io/). I need to add a sample and readme then it is ready for review

resolved

rernas35 avatar Jul 17 '22 11:07 rernas35

@rernas35 i see this pr is still pending can you explain shorty what is the purpose of the new module

this module will enable client to use clickhouse-jdbc functionality in a r2dbc compliant way

rernas35 avatar Jul 17 '22 11:07 rernas35

Thank you @rernas35, really appreciate your efforts on this. Will review this in the coming weekend and merge it into develop if no critical issues.

zhicwu avatar Sep 07 '22 03:09 zhicwu

@rernas35, no action required. Just document some of the feedback and I'll make changes on your branch shortly to address most of them and then merge. Stay tuned :)

zhicwu avatar Sep 11 '22 01:09 zhicwu