ai.databand.azkaban.AzkabanProps Maven / Gradle / Ivy
/*
* © 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