You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2024/02/06 09:38:00 UTC

[jira] [Created] (HIVE-28063) Drop PerfLogger#setPerfLogger method and unused fields/methods

Stamatis Zampetakis created HIVE-28063:
------------------------------------------

             Summary: Drop PerfLogger#setPerfLogger method and unused fields/methods
                 Key: HIVE-28063
                 URL: https://issues.apache.org/jira/browse/HIVE-28063
             Project: Hive
          Issue Type: Task
          Components: Hive, Standalone Metastore
            Reporter: Stamatis Zampetakis
            Assignee: Stamatis Zampetakis


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.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)