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

feat: add position write #4795

Merged
merged 1 commit into from
Jun 26, 2024
Merged

feat: add position write #4795

merged 1 commit into from
Jun 26, 2024

Conversation

hoslo
Copy link
Contributor

@hoslo hoslo commented Jun 24, 2024

Part #4526

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Overall looks good to, thanks a lot!

/// PositionWriter will call this API when:
///
/// - All the data has been written to the buffer and we can perform the upload at once.
fn write_once(&self, body: Buffer) -> impl Future<Output = Result<()>> + MaybeSend;
Copy link
Member

Choose a reason for hiding this comment

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

I feel like PositionWrite don't need write_once anymore since it should be exactly the same with write_all_at(0, buf)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

fn write_all_at(
&self,
offset: u64,
body: Buffer,
Copy link
Member

Choose a reason for hiding this comment

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

Please use buf instead of body in API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

) -> impl Future<Output = Result<()>> + MaybeSend;
}

#[allow(dead_code)]
Copy link
Member

Choose a reason for hiding this comment

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

Those code should not be dead_code since we have exposed them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

}

async fn abort(&mut self) -> Result<()> {
Ok(())
Copy link
Member

Choose a reason for hiding this comment

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

We might consider adding a truncate API to discard existing written data. Let's table this feature for future discussion. Would you like to create an issue for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I created a new issue for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Xuanwo Have any problem yet?

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xuanwo Xuanwo merged commit b18e983 into apache:main Jun 26, 2024
216 checks passed
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.

2 participants