All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.h2o.mojos.runtime.api.PipelineLoaderFactory Maven / Gradle / Ivy

There is a newer version: 2.8.7.1
Show newest version
package ai.h2o.mojos.runtime.api;

import ai.h2o.mojos.runtime.api.backend.ReaderBackend;
import ai.h2o.mojos.runtime.lic.LicenseException;
import java.io.IOException;

public interface PipelineLoaderFactory {
    /**
     * Creates the loader with a given backend
     * @param backend -
     * @param optionalMainFile primary file to load; if null, the one from {@link #getRootResource()} must be used.
     *                         Can be occasionally used with different values, for instance for nested pipelines.
     * @param config configuration of the pipeline
     * @return the pipeline loader; never returns null
     * @throws IOException -
     * @throws LicenseException -
     */
    PipelineLoader createLoader(ReaderBackend backend, String optionalMainFile, final PipelineConfig config) throws IOException, LicenseException;

    /**
     * Same as {@link #createLoader(ReaderBackend, String, PipelineConfig)} but uses {@link PipelineConfig#DEFAULT default} configuration.
     */
    default PipelineLoader createLoader(ReaderBackend backend, String optionalMainFile) throws IOException, LicenseException {
        return this.createLoader(backend, optionalMainFile, PipelineConfig.DEFAULT);
    }

    /**
     * @return simple, constant identification of the loader; like "protobuf" or "toml". Used for debugging,
     * and explicit specification of loader detection order - see {@link MojoPipelineService}.
     */
    String getName();

    /**
     * Primary root resource. It is used a) for determining if that backend can be used to {@link #createLoader(ReaderBackend, String) create a loader} with this factory,
     * and if so, it is passed to the loader as the primary file to load.
     * @return path to primary file inside a {@link ReaderBackend}
     */
    String getRootResource();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy