You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/04/08 09:04:35 UTC

[GitHub] [incubator-doris] imay commented on a change in pull request #3276: [refactor] A small refactor on class DataDir

imay commented on a change in pull request #3276: [refactor] A small refactor on class DataDir
URL: https://github.com/apache/incubator-doris/pull/3276#discussion_r405363840
 
 

 ##########
 File path: be/src/olap/data_dir.cpp
 ##########
 @@ -395,69 +395,47 @@ OLAPStatus DataDir::get_shard(uint64_t* shard) {
     return OLAP_SUCCESS;
 }
 
-OLAPStatus DataDir::register_tablet(Tablet* tablet) {
-    std::lock_guard<std::mutex> l(_mutex);
-
+void DataDir::register_tablet(Tablet* tablet) {
     TabletInfo tablet_info(tablet->tablet_id(), tablet->schema_hash(), tablet->tablet_uid());
-    _tablet_set.insert(tablet_info);
-    return OLAP_SUCCESS;
-}
 
-OLAPStatus DataDir::deregister_tablet(Tablet* tablet) {
     std::lock_guard<std::mutex> l(_mutex);
+    _tablet_set.emplace(tablet_info);
 
 Review comment:
   ```suggestion
       _tablet_set.emplace(std::move(tablet_info));
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org