Adar Dembo has posted comments on this change. Change subject: Rolling-upgrades compat for changing TSRegistrationPB ......................................................................
Patch Set 4: (2 comments) http://gerrit.cloudera.org:8080/#/c/4062/4/src/kudu/master/ts_descriptor.cc File src/kudu/master/ts_descriptor.cc: PS4, Line 68: using HostPortSet = std::unordered_set<HostPort, HostPort::Hasher, HostPort::EqualityPredicate>; : HostPortSet hostports; Interesting, but why not just: unordered_set<HostPort, HostPort::Hasher, HostPort::EqualityPredicate> hostports; PS4, Line 70: for (int i = 0; i < pb1.size(); i++) { : HostPort hp1; : if (!HostPortFromPB(pb1.Get(i), &hp1).ok()) return false; : hostports.insert(hp1); : } : for (int i = 0; i < pb1.size(); i++) { : HostPort hp2; : if (!HostPortFromPB(pb2.Get(i), &hp2).ok()) return false; : if (!ContainsKey(hostports, hp2)) { : return false; : } : } You may be able to get away with unordered_sets of HostPortPB (maybe the generated code does the right thing): unordered_set<HostPortPB> hps1(pb1.begin(), pb1.end()); unordered_set<HostPortPB> hps2(pb2.begin(), pb2.end()); return hps1 == hps2; -- To view, visit http://gerrit.cloudera.org:8080/4062 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I794517d200b1c9ad74b3897b17aa808d68d7924b Gerrit-PatchSet: 4 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Adar Dembo <a...@cloudera.com> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <mpe...@apache.org> Gerrit-Reviewer: Todd Lipcon <t...@apache.org> Gerrit-HasComments: Yes