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

Flatfs #1035

Closed
wants to merge 6 commits into from
Closed

Flatfs #1035

wants to merge 6 commits into from

Conversation

whyrusleeping
Copy link
Member

Not intending to merge this yet, just wanted to get some review and run the tests

tv42 added 5 commits April 7, 2015 12:00
This allows replacing the datastore without needing to write Close
through to every wrapped datastore.
WARNING: No migration performed! That needs to come in a separate
commit, perhaps amended into this one.

Migration must move keyspace "/b" from leveldb to the flatfs subdir,
while removing the "b" prefix (keys should start with just "/").
@jbenet
Copy link
Member

jbenet commented Apr 8, 2015

@whyrusleeping btw, i dont want to merge anything that breaks the repo into master without the migration. see discussion in #975 (comment) so

master <--- repo-1-to-2 <=== {all things that change 1}

@whyrusleeping
Copy link
Member Author

thus me saying "not intending to merge this"

var padding = strings.Repeat("_", maxPrefixLen*hex.EncodedLen(1))

func (fs *Datastore) encode(key datastore.Key) (dir, file string) {
safe := hex.EncodeToString(key.Bytes())
Copy link
Member Author

Choose a reason for hiding this comment

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

@jbenet thoughts on doing:

safe := hex.EncodeToString(key.Bytes()[1:])

to trim off the leading "/" ?

Copy link
Member

Choose a reason for hiding this comment

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

sure

Copy link
Member

Choose a reason for hiding this comment

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

(note btw, that this way of doing things is not compatible with queries with prefixes. one way to do that is encoding each path component separately.) @tv42 and I discussed a while back and figured it'd be fine to leave it as is until we want to put anything other than blocks in here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jbenet You mean because the prefixes wouldn't necessarily align with the directory sharding done here? I think prefix search would be still doable, it just might have to iterate multiple of these shard directories. It won't perform very well, as it'll need to filter out a ton of non-matches, though.

@whyrusleeping whyrusleeping removed the status/in-progress In progress label Apr 19, 2015
@Kubuxu Kubuxu deleted the flatfs branch February 27, 2017 20:39
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.

None yet

3 participants