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

Xiaoyu Yao edited comment on HDDS-317 at 8/22/18 6:26 PM:
----------------------------------------------------------

Thanks [~junjie] for working on this. The patch v2 looks good to me. I just 
have few minor comments:

 

*Ozone-default.xml*

Line 618: some of the description below needs to be updated. 

E.g. remove "The value is specified in GB."

 

*StorageSize.java*

Line 98-117: can we use the existing conf.getStorageSize without introducing 
StorageSize._getStorageSizeInGB_  and StorageSize._getStorageSizeInByte? There 
is a overload method allowing specify target unit when reading the 
configuration. TestConfiguration#testStorageUnit has a bunch of examples that 
may simplify this patch._ 

 

For example in KeyValueHandler.java

Line 152:
{code:java}
maxContainerSizeGB = StorageSize.getStorageSizeInGB(

    config.get(ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE,

    ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT));

{code}
 

can be replaced with
{code:java}
 

Import static* org.apache.hadoop.conf.StorageUnit._GB_;

 

maxContainerSizeGB = config.getStorageSize(

    ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_,

    ScmConfigKeys.OZONE_SCM_CONTAINER_SIZE_DEFAULT, GB));

 

{code}


was (Author: xyao):
Thanks [~junjie] for working on this. The patch v2 looks good to me. I just 
have few minor comments:

 

*Ozone-default.xml*

Line 618: some of the description below needs to be updated. 

E.g. remove "The value is specified in GB."

 

*StorageSize.java*

Line 98-117: can we use the existing conf.getStorageSize without introducing 
StorageSize._getStorageSizeInGB_  and StorageSize._getStorageSizeInByte? There 
is a overload method allowing specify target unit when reading the 
configuration. TestConfiguration#testStorageUnit has a bunch of examples that 
may simplify this patch._ 

 

For example in KeyValueHandler.java

Line 152:

{code}

*maxContainerSizeGB* = StorageSize._getStorageSizeInGB_(

    config.get(ScmConfigKeys.*_OZONE_SCM_CONTAINER_SIZE_*,

    ScmConfigKeys.*_OZONE_SCM_CONTAINER_SIZE_DEFAULT_*));

{code}

 

can be replaced with

{code}

 

*Import static* org.apache.hadoop.conf.StorageUnit.*_GB_*;

 

*maxContainerSizeGB* = config._getStorageSize_(

    ScmConfigKeys.*_OZONE_SCM_CONTAINER_SIZE_*,

    ScmConfigKeys.*_OZONE_SCM_CONTAINER_SIZE_DEFAULT, GB_*));

 

{code}

> Use new StorageSize API for reading ozone.scm.container.size.gb
> ---------------------------------------------------------------
>
>                 Key: HDDS-317
>                 URL: https://issues.apache.org/jira/browse/HDDS-317
>             Project: Hadoop Distributed Data Store
>          Issue Type: Improvement
>          Components: SCM
>            Reporter: Nanda kumar
>            Assignee: Junjie Chen
>            Priority: Major
>              Labels: newbie
>             Fix For: 0.2.1
>
>         Attachments: HDDS-317.2.patch, HDDS-317.patch
>
>
> Container size is configured using property {{ozone.scm.container.size.gb}}. 
> This can be renamed to {{ozone.scm.container.size}} and use new StorageSize 
> API to read the value.
> The property is defined in
>  1. ozone-default.xml
>  2. ScmConfigKeys#OZONE_SCM_CONTAINER_SIZE_GB
> The default value is defined in
>  1. ozone-default.xml
>  2. {{ScmConfigKeys#OZONE_SCM_CONTAINER_SIZE_DEFAULT}}



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