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

[Improve][Connector-V2-kafka] Support setting read starting offset or time at startup config #3157

Merged
merged 6 commits into from
Nov 8, 2022

Conversation

Carl-Zhou-CN
Copy link
Member

Purpose of this pull request

Check list

close #2959

@TyrantLucifer
Copy link
Member

TyrantLucifer commented Oct 21, 2022

Please refer to Coding Guide and change your pull request titile. Thx.

@Carl-Zhou-CN Carl-Zhou-CN changed the title Support setting read starting offset or time at startup config [Improve][Connector-V2-kafka] Support setting read starting offset or time at startup config Oct 21, 2022
@Carl-Zhou-CN
Copy link
Member Author

please refer to Coding Guide and change your pull request titile. Thx.

ok

@Carl-Zhou-CN
Copy link
Member Author

@Hisoka-X @TyrantLucifer Please help to review

Map<TopicPartition, ListOffsetsResult.ListOffsetsResultInfo> listOffsets =
getKafkaPartitionLatestOffset(splits.stream().map(KafkaSourceSplit::getTopicPartition).collect(Collectors.toList()));
Map<TopicPartition, Long> listOffsets =
listOffsets(splits.stream().map(KafkaSourceSplit::getTopicPartition).collect(Collectors.toList()), OffsetSpec.earliest());
Copy link
Member

Choose a reason for hiding this comment

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

Why use OffsetSpec.earliest() not latest?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, it was my mistake. I should have used latest

Copy link
Member

Choose a reason for hiding this comment

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

Maybe you should add some test case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I will add e2e tests later

@EricJoy2048 EricJoy2048 reopened this Oct 29, 2022
Copy link
Member

@Hisoka-X Hisoka-X left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

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

I will merge this pr, and I will create a pr to add change log.

info-2 = 10
}
```

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

ok,thank you

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

Successfully merging this pull request may close these issues.

[Improve][Connector-V2-kafka] Support setting read starting offset or time at startup config
4 participants