adoroszlai commented on a change in pull request #834: HDDS-3101. Depend on
lightweight ConfigurationSource interface instead of Hadoop Configuration
URL: https://github.com/apache/hadoop-ozone/pull/834#discussion_r410162255
##########
File path:
hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/fs/SpaceUsageCheckFactory.java
##########
@@ -68,14 +69,16 @@ default SpaceUsageCheckFactory
setConfiguration(Configuration conf) {
* Defaults to {@link DUFactory} if no class is configured or it cannot be
* instantiated.
*/
- static SpaceUsageCheckFactory create(Configuration config) {
+ static SpaceUsageCheckFactory create(ConfigurationSource config) {
Conf conf = OzoneConfiguration.of(config).getObject(Conf.class);
Class<? extends SpaceUsageCheckFactory> aClass = null;
String className = conf.getClassName();
if (className != null && !className.isEmpty()) {
try {
- aClass = config.getClassByName(className)
- .asSubclass(SpaceUsageCheckFactory.class);
+ aClass =
+ (Class<? extends SpaceUsageCheckFactory>)
Review comment:
Can we keep `.asSubclass(SpaceUsageCheckFactory.class)` instead of the
unchecked cast?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]