Skip to content

HDFS support for DJL


HDFS is widely used in Spark applications. We introduce HDFS integration for DJL to better support Spark use case.

Load model from HDFS

With this module, you can directly load model from HDFS url.

The following pseudocode demonstrates how to load model from HDFS url:

    Criteria<Image, Classifications> criteria =
                .setTypes(Image.class, Classifications.class)

    ZooModel<Image, Classifications> model = criteria.loadModel();

See How to load a model for more detail.

HdfsRepositoryFactory will be registered automatically in DJL as long as you add this module in your class path. If you want to customize your Hadoop configuration, you can manually register a customized HdfsRepositoryFactory:

    Configuration config = new Configuration();
    Repository.registerRepositoryFactory(new HdfsRepositoryFactory(config));


The latest javadocs can be found on here.

You can also build the latest javadocs locally using the following command:

./gradlew javadoc

The javadocs output is built in the build/doc/javadoc folder.


You can pull the module from the central Maven repository by including the following dependency in your pom.xml file: