Dan Burkert has posted comments on this change. Change subject: util: add Status::AndThen combinator ......................................................................
Patch Set 3: (2 comments) http://gerrit.cloudera.org:8080/#/c/7399/3//COMMIT_MSG Commit Message: PS3, Line 9: The AndThen combinator makes it easier to chain together : Status-returning operations when failure recovery is something other : than returning early. RETURN_NOT_OK already handles the return-early : case elegantly. > I think my confusion stemmed from expecting failure recovery to take more o I'm not entirely sure, but I'd be surprised if it made a measurable difference in compile times. http://gerrit.cloudera.org:8080/#/c/7399/3/src/kudu/util/status.h File src/kudu/util/status.h: PS3, Line 187: ok() > In case of very long chains, should we PREDICT_TRUE? And in CloneAndPrepend I wasn't really sure about this. I didn't want to add it to CloneAndPrepend because that method is currently called only when the status is failed. In the case of AndThen, I think the case could be made for it, but I opted to keep it simple for now. If you feel strongly about it I can add it. -- To view, visit http://gerrit.cloudera.org:8080/7399 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia6e1a79ff95406825d4238a8157d242252562805 Gerrit-PatchSet: 3 Gerrit-Project: kudu Gerrit-Branch: master Gerrit-Owner: Dan Burkert <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Dan Burkert <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Todd Lipcon <[email protected]> Gerrit-HasComments: Yes
