Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
Description
The PerfLogger#setPerfLogger is redundant and error-prone.
The small number of current uses could be replaced by simply calling the respective getter (which implicitly changes the underlying ThreadLocal variable).
Ideally thread local variable should never be set after obtaining the initial value. Moreover, allowing any caller to change the thread local variable can affect the correctness of the program.
Dropping this method improves the encapsulation and readability of the class.
The org.apache.hadoop.hive.metastore.metrics.PerfLogger has various unused fields/methods that can be removed as well to improve encapsulation, readability, and maintenance.
Attachments
Issue Links
- links to