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

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

Thanks [~RANith] for patch.

1. No need to create sleep method, keep logic inside the if condition which 
will check nullĀ  for fsdataset.
{code:java}
          if (dn.getFSDataset() != null) {
            ............
            ............
            ............
          }

          try {
            Thread.sleep(detectionInterval);
          } catch (InterruptedException e) {
            LOG.error("Disk Outlier Detection thread interrupted", e);
            Thread.currentThread().interrupt();
          }
{code}
2. Fix the failed test cases. When the {{addSlowDiskForTesting()}} is called 
from UT, daemon thread should not override the status.

3. Fix check-style warnings

> Handle ArrayIndexOutOfBoundsException in 
> DataNodeDiskMetrics#slowDiskDetectionDaemon 
> -------------------------------------------------------------------------------------
>
>                 Key: HDFS-14235
>                 URL: https://issues.apache.org/jira/browse/HDFS-14235
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Surendra Singh Lilhore
>            Assignee: Ranith Sardar
>            Priority: Major
>         Attachments: HDFS-14235.000.patch, NPE.png, exception.png
>
>
> below code throwing exception because {{volumeIterator.next()}} called two 
> time without checking hashNext().
> {code:java}
> while (volumeIterator.hasNext()) {
>   FsVolumeSpi volume = volumeIterator.next();
>   DataNodeVolumeMetrics metrics = volumeIterator.next().getMetrics();
>   String volumeName = volume.getBaseURI().getPath();
>   metadataOpStats.put(volumeName,
>   metrics.getMetadataOperationMean());
>   readIoStats.put(volumeName, metrics.getReadIoMean());
>   writeIoStats.put(volumeName, metrics.getWriteIoMean());
> }{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
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