[ 
https://issues.apache.org/jira/browse/HDFS-12726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16298258#comment-16298258
 ] 

Surendra Singh Lilhore commented on HDFS-12726:
-----------------------------------------------

Thanks [~xiaochen] for patch..

Some review comment for v1 patch.

# {{private static final ThreadLocal<HashMap> chooseRandomReasons}}
Here HashMap is a raw type. it should be parameterized.
e.x :
{code}
  private static final ThreadLocal<Map<NodeNotChosenReason, Integer>> 
chooseRandomReasons = ThreadLocal
      .withInitial(() -> new HashMap<>());
{code}
# No need to log failure reason here.
{code}
      Map<NodeNotChosenReason, Integer> reasonMap = chooseRandomReasons.get();
      if (!reasonMap.isEmpty()) {
        LOG.info("Not enough replicas was chosen. Reason:{}", reasonMap);
      }
      throw new NotEnoughReplicasException(detail);
{code} 
just append reason in {{detail}} string. {{NotEnoughReplicasException}} message 
will be logged in {{chooseTarget(..)}} method.
{code}
      if (LOG.isTraceEnabled()) {
        LOG.trace(message, e);
      } else {
        LOG.warn(message + " " + e.getMessage());
      }
{code}
# I feel {{NodeNotChosenReason#NO_GOOD_STORAGE}} should be 
{{NodeNotChosenReason#NOTE_ENOUGH_STORAGE_SPACE}}. This we are using when 
{{(requiredSize > remaining - scheduledSize)}}

> BlockPlacementPolicyDefault's debugLoggingBuilder may not be logged
> -------------------------------------------------------------------
>
>                 Key: HDFS-12726
>                 URL: https://issues.apache.org/jira/browse/HDFS-12726
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: logging
>            Reporter: Xiao Chen
>            Assignee: Xiao Chen
>              Labels: supportability
>         Attachments: HDFS-12726.01.patch
>
>
> During debugging HDFS-12725, {{BlockPlacementPolicyDefault's}} class' 
> {{debugLoggingBuilder}} does a lot of {{get}} and {{append}}, but never 
> {{toString}} and {{LOG.debug}}'ed.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to