From: Varada Kari Date: Thu, 13 Aug 2015 05:45:00 +0000 (+0530) Subject: Change key format to preserve order of keys in backend db. X-Git-Tag: v9.1.0~315^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf21555ce186b88b4d7cc8485c763a65ef5bf595;p=ceph.git Change key format to preserve order of keys in backend db. Changing the key format to add additional digits to preserve the order for the read aheads and lookups to be faster. Number of digits are selected based on the default object size and default strip size supported by osd. Signed-off-by: Varada Kari --- diff --git a/src/os/KeyValueStore.h b/src/os/KeyValueStore.h index 7220cc35013cf..a93b5cf54cbd3 100644 --- a/src/os/KeyValueStore.h +++ b/src/os/KeyValueStore.h @@ -220,7 +220,7 @@ class KeyValueStore : public ObjectStore, string strip_object_key(uint64_t no) { char n[100]; - snprintf(n, 100, "%lld", (long long)no); + snprintf(n, 100, "%08lld", (long long)no); return string(n); }