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

ai.databand.azkaban.AzkabanProps Maven / Gradle / Ivy

There is a newer version: 1.0.26.1
Show newest version
/*
 * © Copyright Databand.ai, an IBM Company 2022
 */

package ai.databand.azkaban;

import ai.databand.config.JavaOpts;
import ai.databand.config.PropertiesSource;
import ai.databand.config.SimpleProps;
import azkaban.server.AzkabanServer;

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;

public class AzkabanProps implements PropertiesSource {

    private final Map props;

    public AzkabanProps() {
        this(new SimpleProps());
    }

    public AzkabanProps(PropertiesSource parent) {
        props = new HashMap<>(parent.values());
        JavaOpts javaOpts = new JavaOpts(AzkabanServer.getAzkabanProperties().getFlattened());
        props.putAll(javaOpts.values());
    }

    @Override
    public Map values() {
        return props;
    }

    @Override
    public Optional getValue(String key) {
        return Optional.ofNullable(props.get(key));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy