You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Manoj Govindassamy (JIRA)" <ji...@apache.org> on 2016/12/21 22:53:58 UTC

[jira] [Created] (HDFS-11267) Avoid redefinition of storageDirs in NNStorage and cleanup its accessors in Storage

Manoj Govindassamy created HDFS-11267:
-----------------------------------------

             Summary: Avoid redefinition of storageDirs in NNStorage and cleanup its accessors in Storage
                 Key: HDFS-11267
                 URL: https://issues.apache.org/jira/browse/HDFS-11267
             Project: Hadoop HDFS
          Issue Type: Bug
    Affects Versions: 3.0.0-alpha1
            Reporter: Manoj Govindassamy
            Assignee: Manoj Govindassamy



In the abstract class {{Storage}}, {{storageDirs}} is a protected variable and all its derived classes like {{NNStorage}}, {{JNStorage}}, {{DataStorage}}.. are iterating over this non-thread safe variable without any proper locks. Any parallel modification operation like add or remove volume can mutate the backing storageDirs list and any iterators on this list around the  same time can face {{ConcurrentModificationException}}. It would be good to make the variable private and restrict the access via getters and setters. Any thread safe restriction need to be done can then be placed on the parent class only.

Also, {{NNStorage}} redefines parent class Storage's {{storageDirs}}, making it inconsistent with other derived classes. Would be cleaner if {{NNStorage}} can avoid re-defining it locally.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org