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

Add a Rename method? #100

Open
kevina opened this issue Oct 4, 2018 · 3 comments
Open

Add a Rename method? #100

kevina opened this issue Oct 4, 2018 · 3 comments
Assignees

Comments

@kevina
Copy link
Contributor

kevina commented Oct 4, 2018

The migration of the blockstore to multihashs only is going to require a massive renaming off a large number of keys. At least for the flatfs datastore, an important optimization is to rename the file rather than remove and insert a new key. The last time we did such a rename (ipfs/fs-repo-migrations#39) we only had a single datastore config using flatfs so we special cased it. Now things are more complicated with badgerds this will be more difficult.

Is it worth it to provide a Rename method?

@magik6k
Copy link
Member

magik6k commented Oct 5, 2018

Agreed, and I'd suggest implementing this more like a query as some datastores are likely to support prefix renames.

@kevina
Copy link
Contributor Author

kevina commented Oct 5, 2018

Agreed, and I'd suggest implementing this more like a query as some datastores are likely to support prefix renames.

@magik6k can you clarify. I am not sure I am following. I am thinking something very simple and straight forward

  Rename(oldkey, newkey) error

@magik6k
Copy link
Member

magik6k commented Oct 6, 2018

I was thinking about something that would work a bit like linux rename command, possibly restricted to prefix only. That would allow for a nice optimizations in some cases, like ipfs-ds-convert with more advanced datastores.

I'm fine with the basic version too, it might be better in that it will be easier to implement an optimized version for more datastores.

Just throwing ideas.

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