lingbin opened a new issue #2506: Canonicalize the method names related to 
locks in `TabletManager`
URL: https://github.com/apache/incubator-doris/issues/2506
 
 
   Because `TabletManager` is responsible for various operations related to the 
`Tablet`, this class is very large. Because some operations are more 
complicated, many private methods are defined to help, and in order to achieve 
thread-safety, many of these methods are performed in locks 
(`_tablet_map_lock`). But current method names are ambiguous.
   
   Currently, there are several naming patterns for a method (mainly a private 
method) that needs to be executed inside the lock:
   1. **`xxx_with_no_lock()`**: The "with_no_lock" suffix has two meanings: one 
is not needed, and the other is that a lock has been added externally;
   2. **`xxx_unlock()`**: "unlock" is a verb and may be mistaken for unlocking 
in this method.
   3. **`xxx_unlocked()`**: This should be a recommended naming method.
   4. There is no identification in the method name: the reader cannot 
intuitively know whether the method needs to be locked
   
   In order to prevent misunderstanding, we should unify the naming method and 
modify it to **`xxx_unlocked()`** mode to identify that the lock has been 
locked externally, so there is no need to lock in this method.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

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

Reply via email to