Elek, Marton created HDDS-1080: ---------------------------------- Summary: Ozonefs Isolated class loader should support FsStorageStatistics Key: HDDS-1080 URL: https://issues.apache.org/jira/browse/HDDS-1080 Project: Hadoop Distributed Data Store Issue Type: Improvement Components: Ozone Filesystem Reporter: Elek, Marton Assignee: Elek, Marton Attachments: HDDS-1080.001.patch
HDDS-1033 introduced the storage statistics for ozonefs. Unfortunately the isolated classloader (HDDS-922) doesn't work any more after this change. To explain the problem, let's use the specific expression _classname[classloader]_ for a class (named by classname) which is loaded by the classloader. We have two classloaders the _main_ which is the standard classloader of the application and the _isolated_ classloader which is created by the OzoneClientAdapterFactory.java. By default java classloaders delegate the loading to the parent class loader, and they load all the classes from the parent first (if possible). The isolated class loader does the oposit, loads all the classes from a specific location of the jar files. With this approach we can use hadoop3.2+ozone classes together with older hadoop versions. But back to the problem: OzoneFilesystem[main] is loaded by the application. In this class an OzoneFSStorageStatistics[main] is created and with the help of OzoneClientAdapterFactory[main] a new OzoneClientAdapterImpl[isolated!!] is instantiated which implements the OzoneClientAdapter[main] and will do all the main work[isolated]. OzoneClientAdapterImp[isolated] has a new constructor which requires (String[system], String[system], OzoneFSStorageStatistics[isolated]). And this is the problem, it requires OzoneFSStorageStatistics[isolated] but we have a OzoneFSStorageStatistics[main]. The fix is very straightforward. In the FilteredClassLoader.java we ha a list for the classes which should be shared by the two classloaders. For these classes the isolated classloader will delegate the loading to the parent ([main]) classloader and we will have one (and only one) OzoneFSStorageStatistics[main] everywhere. -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org