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

refactor(batch): Use futures-async-stream to implement insert executor #2002

Merged
merged 8 commits into from
Apr 21, 2022

Conversation

D2Lark
Copy link
Contributor

@D2Lark D2Lark commented Apr 21, 2022

What's changed and what's your intention?

Implement Insert using Executor2 trait.

Please explain IN DETAIL what the changes are in this PR and why they are needed:

  • Summarize your change (mandatory)
  • How does this PR work? Need a brief introduction for the changed logic (optional)
  • Describe clearly one logical change and avoid lazy messages (optional)
  • Describe any limitations of the current code (optional)

Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests

Refer to a related PR or issue link (optional)

close #1937

Signed-off-by: d2lark <lichengamoy@gmail.com>
Signed-off-by: d2lark <lichengamoy@gmail.com>
Signed-off-by: d2lark <lichengamoy@gmail.com>
@D2Lark
Copy link
Contributor Author

D2Lark commented Apr 21, 2022

bors try

@bors
Copy link

bors bot commented Apr 21, 2022

🔒 Permission denied

Existing reviewers: click here to make D2Lark a reviewer

Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

Rest LGTM. Thanks for the PR!

impl InsertExecutor2 {
#[try_stream(boxed, ok = DataChunk, error = RwError)]
async fn do_execute(mut self: Box<Self>) {
if !self.executed {
Copy link
Member

Choose a reason for hiding this comment

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

This field is no longer necessary since do_execute takes the ownership of this executor.

insert.next().await?;
insert.close().await?;
let mut stream = insert.execute();
let _ = stream.next().await.unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

This seems to return a Result. We may throw the error by ? here.

Signed-off-by: d2lark <lichengamoy@gmail.com>
Signed-off-by: d2lark <lichengamoy@gmail.com>
Signed-off-by: d2lark <lichengamoy@gmail.com>
@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #2002 (8b15aa3) into main (28cf760) will increase coverage by 0.00%.
The diff coverage is 50.00%.

@@           Coverage Diff           @@
##             main    #2002   +/-   ##
=======================================
  Coverage   70.79%   70.80%           
=======================================
  Files         628      628           
  Lines       80785    80734   -51     
=======================================
- Hits        57193    57161   -32     
+ Misses      23592    23573   -19     
Flag Coverage Δ
rust 70.80% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/batch/src/executor/mod.rs 62.65% <ø> (ø)
src/batch/src/executor2/mod.rs 100.00% <ø> (ø)
src/batch/src/executor2/insert.rs 80.82% <50.00%> (ø)
.../src/executor/managed_state/aggregation/extreme.rs 90.29% <0.00%> (+0.26%) ⬆️
src/meta/src/manager/stream_clients.rs 96.29% <0.00%> (+7.40%) ⬆️
src/batch/src/executor2/executor_wrapper.rs 66.66% <0.00%> (+66.66%) ⬆️

📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

LGTM

@liurenjie1024
Copy link
Contributor

Please resolve conflict first.

@liurenjie1024
Copy link
Contributor

bors try

bors bot added a commit that referenced this pull request Apr 21, 2022
Copy link
Member

@BugenZhao BugenZhao left a comment

Choose a reason for hiding this comment

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

LGTM!

@skyzh skyzh merged commit 1f9ac2e into risingwavelabs:main Apr 21, 2022
@bors
Copy link

bors bot commented Apr 21, 2022

try

Timed out.

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.

Use futures-async-stream to refactor InsertExecutor.
4 participants