Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/19258 )
Change subject: KUDU-3371 [util] add NextOf method for ObjectIdGenerator ...................................................................... Patch Set 2: (5 comments) http://gerrit.cloudera.org:8080/#/c/19258/2//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/19258/2//COMMIT_MSG@9 PS2, Line 9: use nit: using http://gerrit.cloudera.org:8080/#/c/19258/2//COMMIT_MSG@10 PS2, Line 10: usage cases nit: use cases http://gerrit.cloudera.org:8080/#/c/19258/2//COMMIT_MSG@12 PS2, Line 12: plus 1, to act as the upper exclusion key when scan. ... plus 1: that's to provide an exclusive upper bound when scanning http://gerrit.cloudera.org:8080/#/c/19258/2/src/kudu/util/oid_generator.h File src/kudu/util/oid_generator.h: http://gerrit.cloudera.org:8080/#/c/19258/2/src/kudu/util/oid_generator.h@47 PS2, Line 47: static size_t IdLength() { return 32; } Add 'constexpr' to the signature to allow for compile-time optimization? Also, where is it used? I couldn't find it anywhere in the newly added tests or in the implementation of the new NextOf() method. http://gerrit.cloudera.org:8080/#/c/19258/2/src/kudu/util/oid_generator.cc File src/kudu/util/oid_generator.cc: http://gerrit.cloudera.org:8080/#/c/19258/2/src/kudu/util/oid_generator.cc@68 PS2, Line 68: string next(id); : next[next.size() - 1] += 1; : return next; Just curious why to choose this approach instead of appending an extra character. Is it more efficient in predicates to use for RocksDB queries? If using using (id + ".") or (id + "0") instead, that way it's more obvious the value isn't a UUID (and it's not supposed to be, right)? In addition, (id + ".") comes before NextOf(id) in any locale and can be used as inclusive bound as well if all the values are UUIDs of a fixed pre-determined length. $ printf "abc\nabd\nabc.\nabc0\n" | sort abc abc. abc0 abd -- To view, visit http://gerrit.cloudera.org:8080/19258 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I293baa379e8d64adc4ff93acdb0713aae2731c7d Gerrit-Change-Number: 19258 Gerrit-PatchSet: 2 Gerrit-Owner: Yingchun Lai <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: KeDeng <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Yifan Zhang <[email protected]> Gerrit-Reviewer: Yingchun Lai <[email protected]> Gerrit-Reviewer: Yuqi Du <[email protected]> Gerrit-Comment-Date: Tue, 29 Nov 2022 08:51:50 +0000 Gerrit-HasComments: Yes
