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

use path to append data #733

Closed
xiongjiwei opened this issue Sep 1, 2021 · 3 comments
Closed

use path to append data #733

xiongjiwei opened this issue Sep 1, 2021 · 3 comments

Comments

@xiongjiwei
Copy link

for now WriteAppend needs the object which will append to, is it possible to use the path? something like

WriteAppend(path string, r io.Reader, size int64, pairs ...Pair) (n int64, err error)
@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 2, 2021

For most storage services, WriteAppend needs append-offset so our API requires o *Object. To allow our code to run on all storage platforms, it's unlikely to use path only.

@JinnyYi
Copy link
Contributor

JinnyYi commented Sep 2, 2021

  • For object storage like oss, an appendable object is readable, users can perform the AppendObject operation to create an appendable object or append data to an existing object. So use path to append data may seem reasonable at first glance, but users should maintain the append-offset.
  • Service like dropbox needs a start operation to start an append process and a finish operation to mark this appends process has been finished. And before the finish has been called, the object is not readable for user. If use path to append data, users have to upload all the data at once and cannot append anymore.

So for go-storage, Appender is not a single operation like WriteAppend and we use Object to maintain some information for the append object. Ref:

@Xuanwo
Copy link
Contributor

Xuanwo commented Sep 16, 2021

Closed for no more comments. Please feel free to reopen it!

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

No branches or pull requests

3 participants