]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os: KeyValueDB: Add virtual raw_key() function to return (prefix,key) pair
authorJoao Eduardo Luis <joao.luis@inktank.com>
Mon, 23 Jul 2012 18:48:43 +0000 (19:48 +0100)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 24 Jul 2012 01:30:14 +0000 (02:30 +0100)
commita3d57a6e437ca6c75c74998891aba46fde769a2e
treefaf19ce80e2c958c79fbef882afba226fa32714e
parenta16d9c64dab3c24d5522417f91d4e47df5a3e11c
os: KeyValueDB: Add virtual raw_key() function to return (prefix,key) pair

If we were to use solely the key() function, whenever we had a key with,
say, prefix 'Foo' and key 'Bar', the key() function would return something
similar to 'Foo<separator>Bar'. Therefore, obtaining the prefix and the key
would require one to be aware of the separator used, and, since that is
implementation specific, we can't rely on such prior knowledge.

This new function must then be implemented by any derivative class of
KeyValueDB, and is expected to return a pair (prefix,key) for the
current iterator's position -- the key() function should behave as
previously, returning only the 'key' component of the pair.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
src/os/KeyValueDB.h
src/os/LevelDBStore.h
src/test/ObjectMap/KeyValueDBMemory.cc