-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Feature][Connector-V2][Clickhouse] Clickhouse supports spaced write and is relatively real-time data source friendly #4328
Conversation
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
…feature-flush-ck-interval # Conflicts: # docs/en/start-v2/locally/quick-start-flink.md # docs/en/start-v2/locally/quick-start-seatunnel-engine.md
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
…and is relatively real-time data source friendly apache#4309
this.statement = statementMap.get(shardRouter.getShard(shardKey)); | ||
this.clickHouseStatement = statement.getJdbcBatchStatementExecutor(); | ||
this.sizeHolder = statement.getIntHolder(); |
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.
Don't use this
to save fields which mapping with shardKey, because one writer can hold many different shardKey, so it will have many statement
,sizeHolder
. Use this
to save it may cause conflusion.
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.
Should it be?
`statement = statementMap.get(shardRouter.getShard(shardKey));
clickHouseStatement = statement.getJdbcBatchStatementExecutor();
sizeHolder = statement.getIntHolder();
`
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.
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.
Should it be? `statement = statementMap.get(shardRouter.getShard(shardKey));
clickHouseStatement = statement.getJdbcBatchStatementExecutor();
sizeHolder = statement.getIntHolder(); `
No, just do not use ClickhouseSinkWriter
object's fields to save statement
and sizeHolder
. Because it belong shard, not writer. One writer may have many shard.
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.
Should it be?
statement = statementMap.get(shardRouter.getShard(shardKey)); clickHouseStatement = statement.getJdbcBatchStatementExecutor(); sizeHolder = statement.getIntHolder();
No, just do not use
ClickhouseSinkWriter
object's fields to savestatement
andsizeHolder
. Because it belong shard, not writer. One writer may have many shard.
Can you do some hints on code?
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.
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.
I mean one writer may have many sizeHolder
, clickHouseStatement
and statement
. Because one writer have many shard, one shard have one sizeHolder
, clickHouseStatement
and statement
. So the this.sizeHolder
will change when last row had change ( the row change then the last shard also change).
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.
Thank you for your explanation. I think I understand
…and is relatively real-time data source friendly apache#4309
username = "default" | ||
password = "" | ||
batch_interval_ms = "6000" | ||
|
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.
Remove this line.
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.
Remove this line.
batch_interval_ms?You mean using the default?
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.
The line 49 is blank.
…and is relatively real-time data source friendly apache#4309
private transient ClickhouseBatchStatement statement; | ||
private transient IntHolder sizeHolder; | ||
// Whether pre-initialization is required | ||
private transient boolean isOpen; |
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 field is not necessary
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 is a historical commentary Please check the latest
sizeHolder.setValue(sizeHolder.getValue() + 1); | ||
addIntoBatch(element, this.clickHouseStatement); | ||
this.sizeHolder.setValue(this.sizeHolder.getValue() + 1); | ||
tryOpen(); |
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.
Move it into constructer
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 is a historical commentary Please check the latest
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.
+1
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.
-1.
I don't think it is a good way to add additional threads to write data in the sink. This implementation method makes resources uncontrollable, and also loses the original intention of the committer interface design.
same as #4349 |
Purpose of this pull request
Check list
New License Guide
release-note
.