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

Xiaoyu Yao commented on HDDS-116:
---------------------------------

Thanks [~hanishakoneru] for working on this.  I have a few comments below:

 

VolumeInfo.java

Line 32: can we define a enum of volume state to accommodate future changes? We 
can define two states: normal and failed for now. It would be useful to add a 
maintenance mode to prevent new writes onto certain volumes.

 

Line 34: can we use volatile AtomicLong here?

 

Line 36: can we use a builder to allow different ways to construct VolumeInfo? 
We may also want to have a default value for configuredCapacity (e.g, -1) to 
prevent uninitialized volume from being used.

  

VolumeSet.java

 

Line 32:  NIT: unused import

 

Line 84: we will need to be thread safe here, i.e., a consistent VolumeInfo 
from the add/del/update APIs with two list and a HashMap to update. Otherwise, 
this will be a problem when we implement hot pluggable (i.e., dynamically 
adding/removing volumes) or bad volume detection based on these APIs.

 

Line 145-154: can we extract the volume choose strategy as a separate interface 
outside VolumeSet and use composite pattern here? This way, volume choosing 
policy can be evolved without affecting a relatively stable volume set APIs.

 

Line 160: NIT: getVolumeSetIterator->getIterator()

 

Line 168/184: can we return an immutable volume list/map?

> Implement VolumeSet to manage disk volumes
> ------------------------------------------
>
>                 Key: HDDS-116
>                 URL: https://issues.apache.org/jira/browse/HDDS-116
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Hanisha Koneru
>            Assignee: Hanisha Koneru
>            Priority: Major
>              Labels: ContainerIO
>             Fix For: 0.2.1
>
>         Attachments: HDDS-116-HDDS-48.001.patch, HDDS-116-HDDS-48.002.patch
>
>
> VolumeSet would be responsible for managing volumes in the Datanode. Some of 
> its functions are:
>  # Initialize volumes on startup
>  # Provide APIs to add/ remove volumes
>  # Choose and return volume to calling service based on the volume choosing 
> policy (currently implemented Round Robin choosing policy)



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to