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

Mingliang Liu updated HDFS-9129:
--------------------------------
    Attachment: HDFS-9129.022.patch

Thanks [~jingzhao] for your detailed review and I appreciate it very much.

The v22 patch is to address all the comments with the following open discussion:
{quote}
2. The following two initializations may be wrong: with the patch the safemode 
object is created when contructing BlockManager, before loading fsimage and 
editlog from disk.
{code}
private final long startTime = monotonicNow();
private long lastStatusReport = monotonicNow();
{code}
{quote}
In v22 patch, the {{lastStatusReport}} is initialized in {{activate()}} method 
when the status was firstly reported.
The {{startTime}} was the namesystem start time in the {{trunk}} code. As its 
only usage is to calculate how long it takes to leave safemode for status 
report, perhaps we don't need accurate value? An alternative approach is to 
initialize the value in {{activate()}} method.


{quote}
3. {{shouldIncrementallyTrackBlocks}} is actually determined by {{haEnabled}} 
thus looks like it can be declared as final and {{isSafeModeTrackingBlocks}} 
can be simplified.
{quote}
Yes it merely depends on {{haEnabled}} when the {{setBlockTotal()}} is firstly 
called by {{activate()}}. However it's hard to make it final as it's not 
initialized in {{BlockManagerSafeMode}} constructor. In any case, the 
{{isSafeModeTrackingBlocks}} is simplified for sure.

> Move the safemode block count into BlockManager
> -----------------------------------------------
>
>                 Key: HDFS-9129
>                 URL: https://issues.apache.org/jira/browse/HDFS-9129
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Haohui Mai
>            Assignee: Mingliang Liu
>         Attachments: HDFS-9129.000.patch, HDFS-9129.001.patch, 
> HDFS-9129.002.patch, HDFS-9129.003.patch, HDFS-9129.004.patch, 
> HDFS-9129.005.patch, HDFS-9129.006.patch, HDFS-9129.007.patch, 
> HDFS-9129.008.patch, HDFS-9129.009.patch, HDFS-9129.010.patch, 
> HDFS-9129.011.patch, HDFS-9129.012.patch, HDFS-9129.013.patch, 
> HDFS-9129.014.patch, HDFS-9129.015.patch, HDFS-9129.016.patch, 
> HDFS-9129.017.patch, HDFS-9129.018.patch, HDFS-9129.019.patch, 
> HDFS-9129.020.patch, HDFS-9129.021.patch, HDFS-9129.022.patch
>
>
> The {{SafeMode}} needs to track whether there are enough blocks so that the 
> NN can get out of the safemode. These fields can moved to the 
> {{BlockManager}} class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to