[ 
https://issues.apache.org/jira/browse/HBASE-30591?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiao Liu updated HBASE-30591:
-----------------------------
    Description: 
h3. Problem

Both the Master (\{{MobFileCleanupUtil.checkColumnFamilyDescriptor()}}) and the 
RegionServer (\{{RSMobFileCleanerChore.chore()}}) list MOB column family 
directories using \{{listLocatedStatus()}}. Each returned 
\{{LocatedFileStatus}} already contains the file's modification time.

For each file that reaches the age check, both implementations call 
\{{getFileStatus(path)}} once to compare the modification time with the archive 
cutoff and again to log the decision. The second call runs even when TRACE is 
disabled because Java evaluates the log arguments before invoking the logger. 
On HDFS, this adds two NameNode metadata RPCs per candidate file.

h3. Proposed change

In both cleanup paths, read the modification time once from 
\{{LocatedFileStatus.getModificationTime()}} and reuse it for the cutoff 
comparison and the trace message. Update the variable names and log messages to 
refer to modification time.

  was:
h3. Problem

{\{MobFileCleanupUtil.checkColumnFamilyDescriptor()}} lists the MOB column 
family directory using \{{listLocatedStatus()}}. Each returned 
\{{LocatedFileStatus}} already contains the file's modification time.

For each file that reaches the age check, the cleaner calls 
\{{getFileStatus(path)}} twice: once for the archive cutoff comparison and once 
for the \{{TRACE}} log message. The second call also runs when TRACE is 
disabled because Java evaluates the log arguments before invoking the logger. 
On HDFS, this adds two NameNode metadata RPCs per candidate file.

h3. Proposed change

Read the modification time once from 
\{{LocatedFileStatus.getModificationTime()}} and reuse it for the cutoff 
comparison and both log branches.


> Avoid redundant getFileStatus calls when checking MOB file age
> --------------------------------------------------------------
>
>                 Key: HBASE-30591
>                 URL: https://issues.apache.org/jira/browse/HBASE-30591
>             Project: HBase
>          Issue Type: Improvement
>          Components: mob
>            Reporter: Xiao Liu
>            Assignee: Xiao Liu
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 4.0.0-alpha-1, 2.7.0, 3.1.0, 3.0.1, 2.6.8, 2.5.17
>
>
> h3. Problem
> Both the Master (\{{MobFileCleanupUtil.checkColumnFamilyDescriptor()}}) and 
> the RegionServer (\{{RSMobFileCleanerChore.chore()}}) list MOB column family 
> directories using \{{listLocatedStatus()}}. Each returned 
> \{{LocatedFileStatus}} already contains the file's modification time.
> For each file that reaches the age check, both implementations call 
> \{{getFileStatus(path)}} once to compare the modification time with the 
> archive cutoff and again to log the decision. The second call runs even when 
> TRACE is disabled because Java evaluates the log arguments before invoking 
> the logger. On HDFS, this adds two NameNode metadata RPCs per candidate file.
> h3. Proposed change
> In both cleanup paths, read the modification time once from 
> \{{LocatedFileStatus.getModificationTime()}} and reuse it for the cutoff 
> comparison and the trace message. Update the variable names and log messages 
> to refer to modification time.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to