Todd Lipcon has posted comments on this change. Change subject: KUDU-2055 [part 2]: Add util to construct sorted disjoint interval list ......................................................................
Patch Set 2: (5 comments) http://gerrit.cloudera.org:8080/#/c/8041/2/src/kudu/util/sorted_disjoint_interval_list.h File src/kudu/util/sorted_disjoint_interval_list.h: Line 57: template<class Traits> do we still need a traits class if it's just a single point type involved? Line 88: LOG(ERROR) << strings::Substitute("invalid interval: [$0, $1]", this going into the error log will probably never get noticed. Why not make this whole algorithm just be a method like: template<class point_type> Status CoalesceIntervals(std::vector<std::pair<point_type, point_type>>* intervals); rather than being a class? PS2, Line 95: , [](const Point& a, const Point& b) { : if (a.first == b.first) return a.second < b.second; : return a.first < b.first; : is this comparator necessary? I think the default comparator for std::pair<> already does lexicographic comparison (http://en.cppreference.com/w/cpp/utility/pair/operator_cmp) Line 108: cur_start = point.first; style: add {}s around if statement PS2, Line 111: ClosedInterval do you need ClosedInterval here? emplace_back already takes a variable length argument list which is forwarded to the constructor of the container element type -- To view, visit http://gerrit.cloudera.org:8080/8041 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61a813c047be4882f246eaf404598e7e18fcac87 Gerrit-PatchSet: 2 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Alexey Serbin <aser...@cloudera.com> Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com> Gerrit-Reviewer: David Ribeiro Alves <davidral...@gmail.com> Gerrit-Reviewer: Hao Hao <hao....@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes