forked from apache/kudu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
metrics: replace kudu::Bind usage with lambdas in FunctionGauge
Let's start with a little history lesson. Back in 2014, we imported Chromium's Bind (and associated machinery) into gutil as kudu::Bind. At the time we hadn't migrated to C++11, so we couldn't use lambdas, and the kudu::Bind feature set was rich[1], at least as compared to boost::bind. Now that we're on C++11 and can use lambdas, there's very little that kudu::Bind can do that lambdas can't. The only thing that comes to mind is passing ownership of an object to a callback via the kudu::Owned() or kudu::Passed() wrappers, and we're not using those features. So in the interest of modernizing the Kudu codebase a bit, I'm going to replace kudu::Bind with lambdas. Lambdas are simpler, can be more easily inlined by the compiler, and will result in a reduction of code at the end when we remove kudu::Bind and friends from the repo. This patch kicks off the conversion process by using lambdas in FunctionGauge, which is a heavily used source of kudu::Bind. 1. See commit 66282df. Change-Id: If60a0dabde1fde1465d73dd9e8edc244fc780c37 Reviewed-on: http://gerrit.cloudera.org:8080/15474 Reviewed-by: Bankim Bhavsar <[email protected]> Tested-by: Adar Dembo <[email protected]> Reviewed-by: Andrew Wong <[email protected]>
- Loading branch information
Showing
21 changed files
with
131 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.