cockroachdb/cockroach — pull request #100 by spencerkimball (2014-10-02 20:54:55+00:00)
Title: Add engine.Key.Address() method for addressing local keys.

Local keys are keys which are located on the same range as other keys
minus a local key prefix. Local key prefixes take the form:
"\x00\x00\x00[4 characters]". Any commands addressed to keys of this
form are direct to the range containing the same key minus the prefix.
Transaction records, response cache entries, range metadata (and
in the future others) all have local keys.

Changed cases where we write directly to the underlying engine to use
binary-encoded keys. Now that we binary encode all keys, need to pass
correct prefixes to the C++ custom compaction filter for GC. In this
way, we avoid having C++ need implementations of our decoding methods.

Moved a number of methods into methods of struct engine.Key. Added
associated unittests.