]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: document ghobject sort order rationale 652/head
authorLoic Dachary <loic@dachary.org>
Fri, 27 Sep 2013 17:09:23 +0000 (19:09 +0200)
committerLoic Dachary <loic@dachary.org>
Wed, 2 Oct 2013 07:17:09 +0000 (09:17 +0200)
Intuition differs regarding the sort order of the ghobject shard and
generation. Document the rationale for the chosen sort order.

Reviewed-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: David Zafman <david.zafman@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
src/common/hobject.h

index 46fc67b893a47e4b82a75e8ddb41ca3eab50502b..82eecf3bfc7b24887266abfcc39af3a7d7f2bf36 100644 (file)
@@ -288,8 +288,12 @@ namespace __gnu_cxx {
 
 ostream& operator<<(ostream& out, const ghobject_t& o);
 
-WRITE_EQ_OPERATORS_3(ghobject_t, hobj, generation, shard_id)
-// sort ghobject_t's by <hobj, generation, shard_id>
+WRITE_EQ_OPERATORS_3(ghobject_t, hobj, shard_id, generation)
+// sort ghobject_t's by <hobj, shard_id, generation> 
+// 
+// Two objects which differ by generation are more related than
+// two objects of the same generation which differ by shard.
+// 
 WRITE_CMP_OPERATORS_3(ghobject_t,
                      hobj,
                      shard_id,