Search in sources :

Example 1 with FileSystemRegistrar

use of org.flyte.jflyte.api.FileSystemRegistrar in project flytekit-java by flyteorg.

the class FileSystemLoader method loadFileSystems.

static List<FileSystem> loadFileSystems() {
    ServiceLoader<FileSystemRegistrar> loader = ServiceLoader.load(FileSystemRegistrar.class);
    LOG.debug("Discovering FileSystemRegistrar");
    List<FileSystem> fileSystems = new ArrayList<>();
    Map<String, String> env = ImmutableMap.copyOf(System.getenv());
    for (FileSystemRegistrar registrar : loader) {
        for (FileSystem fileSystem : registrar.load(env)) {
            LOG.debug(String.format("Discovered FileSystem [%s]", fileSystem.getClass().getName()));
            fileSystems.add(fileSystem);
        }
    }
    return fileSystems;
}
Also used : FileSystemRegistrar(org.flyte.jflyte.api.FileSystemRegistrar) FileSystem(org.flyte.jflyte.api.FileSystem) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)1 FileSystem (org.flyte.jflyte.api.FileSystem)1 FileSystemRegistrar (org.flyte.jflyte.api.FileSystemRegistrar)1