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

[Feature][Connector-V2] [Amazondynamodb Connector]add amazondynamodb source & sink connnector #3166

Merged
merged 28 commits into from
Nov 4, 2022

Conversation

liugddx
Copy link
Member

@liugddx liugddx commented Oct 24, 2022

Purpose of this pull request

Check list

@liugddx liugddx marked this pull request as draft October 24, 2022 01:32
Copy link
Member

@hailin0 hailin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 33 to 34
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

@liugddx
Copy link
Member Author

liugddx commented Oct 24, 2022

add docs into this ?

https://github.com/apache/incubator-seatunnel/tree/dev/docs/en/connector-v2

Thank you for your codereview,and this pr is still under development. I will fix all the problems.

@liugddx liugddx marked this pull request as ready for review October 30, 2022 12:15
@liugddx
Copy link
Member Author

liugddx commented Oct 31, 2022

PTAL @hailin0 @Hisoka-X @EricJoy2048 @ic4y @CalvinKirs thanks.


private final AmazondynamodbSourceOptions amazondynamodbSourceOptions;
private final SeaTunnelRowType seaTunnelRowType;
private final DynamoDbClient dynamoDbClient;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does DynamoDbClient support serialization? Under different engines, the construction and write methods of the SinkWriter object may not be called in the same jvm.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SinkWriter will in same jvm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault, sinkwriter doesn't need serialization.

@Override
public void write(SeaTunnelRow element) throws IOException {

dynamoDbClient.putItem(convertRow(element, seaTunnelRowType));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is putItem a synchronous write, can I use batch write to improve performance

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is putItem a synchronous write, can I use batch write to improve performance

Is putItem a synchronous write, can I use batch write to improve performance

Done.

@liugddx liugddx requested review from ic4y and removed request for ic4y October 31, 2022 11:38

## Key features

- [x] [batch](../../concept/connector-v2-features.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sink Connector Features only contain exactly-once and schema projection.

Comment on lines 15 to 16
- [ ] [parallelism](../../concept/connector-v2-features.md)
- [ ] [support user-defined split](../../concept/connector-v2-features.md)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@liugddx
Copy link
Member Author

liugddx commented Nov 1, 2022

#3018

@EricJoy2048 EricJoy2048 closed this Nov 1, 2022
@EricJoy2048 EricJoy2048 reopened this Nov 1, 2022
@liugddx liugddx closed this Nov 1, 2022
@liugddx liugddx reopened this Nov 1, 2022
@liugddx liugddx closed this Nov 2, 2022
@liugddx liugddx reopened this Nov 2, 2022
@Hisoka-X
Copy link
Member

Hisoka-X commented Nov 2, 2022

Don't worry, This is a bug about engine, fixed by #3216

scheduledFuture.cancel(false);
scheduler.shutdown();
}
flush();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The close method will also be called when no data is written, and dynamoDbClient will have a null pointer exception at this time. This can be tested by a task where the source does not output any data.

public int batchIntervalMs = DEFAULT_BATCH_INTERVAL_MS;

public AmazondynamodbSourceOptions(Config config) {
if (config.hasPath(AmazondynamodbConfig.URL)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem like these config don't have default value, maybe you should use CheckConfigUtil.checkAllExists to make sure user didn't forget config it.

@liugddx liugddx requested a review from ic4y November 2, 2022 10:08
public int batchIntervalMs = DEFAULT_BATCH_INTERVAL_MS;

public AmazondynamodbSourceOptions(Config config) {
if (config.hasPath(AmazondynamodbConfig.URL)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already check it exist, No need to check again

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already check it exist, No need to check again

Done.

@liugddx liugddx closed this Nov 3, 2022
@liugddx liugddx reopened this Nov 3, 2022
@liugddx liugddx closed this Nov 3, 2022
@liugddx liugddx reopened this Nov 3, 2022
Copy link
Contributor

@ic4y ic4y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@EricJoy2048 EricJoy2048 merged commit 183bac0 into apache:dev Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants