@Inject public StatusService(final Props props, final ExecutorLoader executorLoader, final DatabaseOperator dbOperator) { this.executorLoader = executorLoader; this.dbOperator = dbOperator; this.pidFilename = props.getString(ConfigurationKeys.AZKABAN_PID_FILENAME, "currentpid"); }
private Class<? extends AzkabanDataSource> resolveDataSourceType() { final String databaseType = this.props.getString("database.type"); if (databaseType.equals("h2")) { return H2FileDataSource.class; } else { return MySQLDataSource.class; } }
static String getURLForTopic(final String topic, final Props azkProps) { return azkProps.getString( Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_TOPIC_URL.replace("${topic}", topic), ""); }
@Inject public EmailMessageCreator(final Props props) { this.mailHost = props.getString("mail.host", "localhost"); this.mailPort = props.getInt("mail.port", DEFAULT_SMTP_PORT); this.mailUser = props.getString("mail.user", ""); this.mailPassword = props.getString("mail.password", ""); this.mailSender = props.getString("mail.sender", ""); this.tls = props.getString("mail.tls", "false"); this.usesAuth = props.getBoolean("mail.useAuth", true); }
private void setupExecutorFilterList() { // initialize hard filters for executor selector from azkaban.properties final String filters = this.azkProps .getString(ConfigurationKeys.EXECUTOR_SELECTOR_FILTERS, ""); if (filters != null) { this.filterList = Arrays.asList(StringUtils.split(filters, ",")); } }
@Inject public JdbcProjectImpl(final Props props, final DatabaseOperator databaseOperator) { this.dbOperator = databaseOperator; this.tempDir = new File(props.getString("project.temp.dir", "temp")); if (!this.tempDir.exists()) { if (this.tempDir.mkdirs()) { logger.info("project temporary folder is being constructed."); } else { logger.info("project temporary folder already existed."); } } }
@Inject public StorageManager(final Props props, final Storage storage, final ProjectLoader projectLoader, final StorageCleaner storageCleaner) { this.tempDir = new File(props.getString("project.temp.dir", "temp")); this.storage = requireNonNull(storage, "storage is null"); this.projectLoader = requireNonNull(projectLoader, "projectLoader is null"); this.storageCleaner = requireNonNull(storageCleaner, "storageCleanUp is null"); prepareTempDir(); }
@Inject public HdfsAuth(final Props props, final Configuration conf) { UserGroupInformation.setConfiguration(conf); this.isSecurityEnabled = UserGroupInformation.isSecurityEnabled(); if (this.isSecurityEnabled) { log.info("The Hadoop cluster has enabled security"); this.keytabPath = requireNonNull(props.getString(AZKABAN_KEYTAB_PATH)); this.keytabPrincipal = requireNonNull(props.getString(AZKABAN_KERBEROS_PRINCIPAL)); } }
public String getWorkingDirectory() { final String workingDir = getJobProps().getString(WORKING_DIR, this._jobPath); if (workingDir == null) { return ""; } return workingDir; }
public AbstractMailer(final Props props, final EmailMessageCreator messageCreator) { this.azkabanName = props.getString("azkaban.name", "azkaban"); this.messageCreator = messageCreator; final long maxAttachmentSizeInMB = props.getInt("mail.max.attachment.size.mb", 100); this.attachmentMazSizeInByte = maxAttachmentSizeInMB * MB_IN_BYTES; }
@Inject public AzkabanCommonModuleConfig(final Props props) { this.props = props; this.storageImplementation = props.getString(AZKABAN_STORAGE_TYPE, this.storageImplementation); this.localStorageBaseDirPath = props .getString(AZKABAN_STORAGE_LOCAL_BASEDIR, this.localStorageBaseDirPath); this.hdfsRootUri = props.get(AZKABAN_STORAGE_HDFS_ROOT_URI) != null ? props .getUri(AZKABAN_STORAGE_HDFS_ROOT_URI) : null; }
private Map<String, Alerter> loadAlerters(final Props props, final Emailer mailAlerter) { final Map<String, Alerter> allAlerters = new HashMap<>(); // load built-in alerters allAlerters.put("email", mailAlerter); // load all plugin alerters final String pluginDir = props.getString("alerter.plugin.dir", "plugins/alerter"); allAlerters.putAll(loadPluginAlerters(pluginDir)); return allAlerters; }
public JobSummaryServlet(final Props props) { this.props = props; this.viewerName = props.getString("viewer.name"); this.viewerPath = props.getString("viewer.path"); this.webResourcesPath = new File(new File(props.getSource()).getParentFile().getParentFile(), "web"); this.webResourcesPath.mkdirs(); setResourceDirectory(this.webResourcesPath); }
/** * The constructor. */ public XmlUserManager(final Props props) { this.xmlPath = props.getString(XML_FILE_PARAM); parseXMLFile(); }
@Inject public H2FileDataSource(final Props props) { super(); final String filePath = props.getString("h2.path"); final Path h2DbPath = Paths.get(filePath).toAbsolutePath(); final String url = "jdbc:h2:file:" + h2DbPath + ";IGNORECASE=TRUE"; setDriverClassName("org.h2.Driver"); setUrl(url); }
public static String getExternalLogViewer(final Props azkProps, final String jobId, final Props jobProps) { // If no topic was configured to be an external analyzer, return empty if (!azkProps .containsKey(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_LOGVIEWER_TOPIC)) { return ""; } // Find out which external link we should use to lead to our log viewer final String topic = azkProps .getString(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_LOGVIEWER_TOPIC); return getLinkFromJobAndExecId(topic, azkProps, jobId, jobProps); }
public static String getExternalAnalyzerOnReq(final Props azkProps, final HttpServletRequest req) { // If no topic was configured to be an external analyzer, return empty if (!azkProps.containsKey(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_ANALYZER_TOPIC)) { return ""; } // Find out which external link we should use to lead to our analyzer final String topic = azkProps .getString(Constants.ConfigurationKeys.AZKABAN_SERVER_EXTERNAL_ANALYZER_TOPIC); return getLinkFromRequest(topic, azkProps, req); }
private static void updateDerivedConfigs(final Props azkabanSettings) { final boolean isSslEnabled = azkabanSettings.getBoolean("jetty.use.ssl", true); final int port = isSslEnabled ? azkabanSettings.getInt("jetty.ssl.port", DEFAULT_SSL_PORT_NUMBER) : azkabanSettings.getInt("jetty.port", DEFAULT_PORT_NUMBER); // setting stats configuration for connectors final String hostname = azkabanSettings.getString("jetty.hostname", "localhost"); azkabanSettings.put("server.hostname", hostname); azkabanSettings.put("server.port", port); azkabanSettings.put("server.useSSL", String.valueOf(isSslEnabled)); }