Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2823 SCM HA Support
  3. HDDS-4624

Fix set configs in SCMHAConfigration

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      If running the following code:

          SCMHAConfiguration scmhaConfiguration = conf.getObject(
              SCMHAConfiguration.class);
          scmhaConfiguration.setRatisStorageDir("scm-ratis");
          conf.setFromObject(scmhaConfiguration);
      

      Will get the following exception:

      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)
      

      Attachments

        Issue Links

          Activity

            People

              amaliujia Rui Wang
              amaliujia Rui Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: