Hello Dan Burkert, Alexey Serbin,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/7909
to review the following change.
Change subject: master: always use smart pointers when accessing TableInfo and
TabletInfo
......................................................................
master: always use smart pointers when accessing TableInfo and TabletInfo
Mixing scoped_refptr and raw access is error-prone and complicated code by
forcing the use of both in certain places. It's fair to be concerned about
the overhead; as far as I can tell it's minimal, because it's either in
functions that are already "slow" (like {Create,Alter,Delete}Table and the
equivalent in CatalogManagerBgTasks), or the call sites pass the object by
cref and thus avoid an extra ref/deref in the first place.
I also reduced the number of ways to add/remove TabletInfo objects to a
TableInfo down to one.
Finally, I couldn't help myself and did some more modernization:
- Removed a couple std:: prefixes.
- Added "auto" to some loops.
- Replaced some vector::push_back calls with emplace_back.
- Reformatted double '>' (C++11 allows them to be adjacent).
Change-Id: I3c74f2aa048ee85cc3a5f863ce8f38147e78c5ae
---
M src/kudu/master/catalog_manager-test.cc
M src/kudu/master/catalog_manager.cc
M src/kudu/master/catalog_manager.h
M src/kudu/master/sys_catalog-test.cc
M src/kudu/master/sys_catalog.cc
M src/kudu/master/sys_catalog.h
6 files changed, 123 insertions(+), 182 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/09/7909/1
--
To view, visit http://gerrit.cloudera.org:8080/7909
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3c74f2aa048ee85cc3a5f863ce8f38147e78c5ae
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Dan Burkert <[email protected]>