[ 
https://issues.apache.org/jira/browse/HDDS-4624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rui Wang updated HDDS-4624:
---------------------------
    Description: 
If running the following code:

{code:java}
    SCMHAConfiguration scmhaConfiguration = conf.getObject(
        SCMHAConfiguration.class);
    scmhaConfiguration.setRatisStorageDir("scm-ratis");
    conf.setFromObject(scmhaConfiguration);
{code}

Will get the following exception:

{code:java}
java.lang.IllegalArgumentException: Attempt to get double field 
"org.apache.hadoop.hdds.scm.ha.SCMHAConfiguration.raftSegmentSize" with illegal 
data type conversion to long

        at 
sun.reflect.UnsafeFieldAccessorImpl.newGetIllegalArgumentException(UnsafeFieldAccessorImpl.java:69)
        at 
sun.reflect.UnsafeFieldAccessorImpl.newGetLongIllegalArgumentException(UnsafeFieldAccessorImpl.java:136)
        at 
sun.reflect.UnsafeDoubleFieldAccessorImpl.getLong(UnsafeDoubleFieldAccessorImpl.java:60)
        at java.lang.reflect.Field.getLong(Field.java:611)
        at 
org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfigurationFromObject(ConfigurationReflectionUtil.java:247)
        at 
org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfiguration(ConfigurationReflectionUtil.java:199)
        at 
org.apache.hadoop.hdds.conf.ConfigurationTarget.setFromObject(ConfigurationTarget.java:55)
        at org.apache.hadoop.hdds.scm.TestUtils.getScmSimple(TestUtils.java:484)
        at 
org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.createSCM(MiniOzoneClusterImpl.java:634)
        at 
org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.build(MiniOzoneClusterImpl.java:522)
        at 
org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientAbstract.startCluster(TestOzoneRpcClientAbstract.java:173)
        at 
org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis.init(TestOzoneRpcClientWithRatis.java:71)
{code}


  was:
If running the following code:

{code:java}
    SCMHAConfiguration scmhaConfiguration = conf.getObject(
        SCMHAConfiguration.class);
    scmhaConfiguration.setRatisStorageDir("scm-ratis");
    conf.setFromObject(scmhaConfiguration);
{code}



{code:java}
java.lang.IllegalArgumentException: Attempt to get double field 
"org.apache.hadoop.hdds.scm.ha.SCMHAConfiguration.raftSegmentSize" with illegal 
data type conversion to long

        at 
sun.reflect.UnsafeFieldAccessorImpl.newGetIllegalArgumentException(UnsafeFieldAccessorImpl.java:69)
        at 
sun.reflect.UnsafeFieldAccessorImpl.newGetLongIllegalArgumentException(UnsafeFieldAccessorImpl.java:136)
        at 
sun.reflect.UnsafeDoubleFieldAccessorImpl.getLong(UnsafeDoubleFieldAccessorImpl.java:60)
        at java.lang.reflect.Field.getLong(Field.java:611)
        at 
org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfigurationFromObject(ConfigurationReflectionUtil.java:247)
        at 
org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfiguration(ConfigurationReflectionUtil.java:199)
        at 
org.apache.hadoop.hdds.conf.ConfigurationTarget.setFromObject(ConfigurationTarget.java:55)
        at org.apache.hadoop.hdds.scm.TestUtils.getScmSimple(TestUtils.java:484)
        at 
org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.createSCM(MiniOzoneClusterImpl.java:634)
        at 
org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.build(MiniOzoneClusterImpl.java:522)
        at 
org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientAbstract.startCluster(TestOzoneRpcClientAbstract.java:173)
        at 
org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis.init(TestOzoneRpcClientWithRatis.java:71)
{code}



> Fix set configs in SCMHAConfigration 
> -------------------------------------
>
>                 Key: HDDS-4624
>                 URL: https://issues.apache.org/jira/browse/HDDS-4624
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Rui Wang
>            Assignee: Rui Wang
>            Priority: Major
>
> If running the following code:
> {code:java}
>     SCMHAConfiguration scmhaConfiguration = conf.getObject(
>         SCMHAConfiguration.class);
>     scmhaConfiguration.setRatisStorageDir("scm-ratis");
>     conf.setFromObject(scmhaConfiguration);
> {code}
> Will get the following exception:
> {code:java}
> java.lang.IllegalArgumentException: Attempt to get double field 
> "org.apache.hadoop.hdds.scm.ha.SCMHAConfiguration.raftSegmentSize" with 
> illegal data type conversion to long
>       at 
> sun.reflect.UnsafeFieldAccessorImpl.newGetIllegalArgumentException(UnsafeFieldAccessorImpl.java:69)
>       at 
> sun.reflect.UnsafeFieldAccessorImpl.newGetLongIllegalArgumentException(UnsafeFieldAccessorImpl.java:136)
>       at 
> sun.reflect.UnsafeDoubleFieldAccessorImpl.getLong(UnsafeDoubleFieldAccessorImpl.java:60)
>       at java.lang.reflect.Field.getLong(Field.java:611)
>       at 
> org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfigurationFromObject(ConfigurationReflectionUtil.java:247)
>       at 
> org.apache.hadoop.hdds.conf.ConfigurationReflectionUtil.updateConfiguration(ConfigurationReflectionUtil.java:199)
>       at 
> org.apache.hadoop.hdds.conf.ConfigurationTarget.setFromObject(ConfigurationTarget.java:55)
>       at org.apache.hadoop.hdds.scm.TestUtils.getScmSimple(TestUtils.java:484)
>       at 
> org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.createSCM(MiniOzoneClusterImpl.java:634)
>       at 
> org.apache.hadoop.ozone.MiniOzoneClusterImpl$Builder.build(MiniOzoneClusterImpl.java:522)
>       at 
> org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientAbstract.startCluster(TestOzoneRpcClientAbstract.java:173)
>       at 
> org.apache.hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis.init(TestOzoneRpcClientWithRatis.java:71)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to