Currently Ozone relies on HADOOP_* environment variables (eg. HADOOP_HOME) for historical and practical reasons (code reuse). This can lead to unexpected results if Hadoop and Ozone are both present on a node and they share their environment. Eg. we had to implement a workaround for finding ozone-config.sh relative to the script being executed when HADOOP_HOME points to Hadoop, not Ozone (
HDDS-1912 and HDDS-4450).
Another similar severe problem happens if we would like to access Ozone filesystem both via ozone and hadoop commands. The latter needs shaded Ozone FS JAR in HADOOP_CLASSPATH. The same HADOOP_CLASSPATH results in ClassNotFound for ozone.
The solution proposed in
Long-term we may need to replace all the HADOOP_ environment variable with an OZONE_ environment variable, but that would be a significant bigger change.
This would allow using different classpaths, logging parameters, and more.
To be backward compatible, we should use existing HADOOP_ variables as fallback for the corresponding OZONE_ ones, but let OZONE_X take precedence over HADOOP_X if the former is defined.