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

Reorganized all local keys into two sections/range: by ID & by Key. #264

Merged
merged 2 commits into from
Jan 16, 2015

Conversation

spencerkimball
Copy link
Member

This groups all of the range-local data contiguously into two sections,
making range traversals require less seeks and more importantly, less
maintenance as new range-local data is added going forward.

The trickiest part of this was upgrading the C++ code to properly
account for encoded keys, since it now has to decode the key and skip
the range ID or range Key to determine whether the tuple being compacted
is a transaction record or response cache entry.

This groups all of the range-local data contiguously into two sections,
making range traversals require less seeks and more importantly, less
maintenance as new range-local data is added going forward.

The trickiest part of this was upgrading the C++ code to properly
account for encoded keys, since it now has to decode the key and skip
the range ID or range Key to determine whether the tuple being compacted
is a transaction record or response cache entry.
@spencerkimball spencerkimball force-pushed the spencerkimball/local-keyspace branch from 62ad7fa to 287f8f7 Compare January 16, 2015 21:18

// RaftLogPrefix returns the system-local prefix shared by all entries in a Raft log.
func RaftLogPrefix(raftID int64) proto.Key {
return MakeKey(KeyLocalRangeIDPrefix, encoding.EncodeInt(nil, raftID), KeyLocalRaftLogSuffix)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this just call MakeRangeIDKey(raftID, KeyLocalRaftLogSuffix, nil)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, not sure why I did that. Changed.

@bdarnell
Copy link
Contributor

LGTM

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.

2 participants