code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
private void handleDeleteImageVersion(final HttpServletRequest req, final HttpServletResponse resp, final Session session, final Map<String, String> templateVariableToValue) throws ServletException, IOException { try { final String idString = templateVariableToValue.get(IMAGE_VERSION_ID_KEY)...
This servlet exposes the REST APIs such as create, get etc. for image type. Below are the supported APIs. Create Image Version API: POST /imageVersions?session.id=? --data @payload.json Search/Get Image Versions API: GET /imageVersions?session.id=?&imageType=?&imageVersion=?&versionState=? GET /imageVersions/{id}?sessi...
handleDeleteImageVersion
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/imagemgmt/servlets/ImageVersionServlet.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/imagemgmt/servlets/ImageVersionServlet.java
Apache-2.0
public static <T> boolean validateObject(final T obj, final List<String> validationErrors) { final Validator validator = validatorFactory.getValidator(); final Set<ConstraintViolation<T>> violations = validator.validate(obj); if (violations.isEmpty()) { return true; } log.error("Object validat...
Performs validation the supplied object and creates set of violations. Returns if there is no violation. Returns false if there exist any violation. @param obj @param <T> @param validationErrors @return boolean
validateObject
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/imagemgmt/utils/ValidatorUtils.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/imagemgmt/utils/ValidatorUtils.java
Apache-2.0
public static <T> boolean validateObject(final T obj, final List<String> validationErrors, final Class<?> validationGroup) { final Validator validator = validatorFactory.getValidator(); final Set<ConstraintViolation<T>> violations = validator.validate(obj, validationGroup); if (violations.isEmpty()) {...
Performs validation the supplied object and creates set of violations. Returns if there is no violation. Returns false if there exist any violation. This method performs validation for the annotations with validation group class. @param obj @param <T> @return boolean
validateObject
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/imagemgmt/utils/ValidatorUtils.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/imagemgmt/utils/ValidatorUtils.java
Apache-2.0
protected static <T extends Serializable> T asT(final Object service, final Class<T> type) { return type.cast(service); }
Cast the object to the original one with the type. The object must extend Serializable.
asT
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java
Apache-2.0
protected Object getKey(final JobExecutionContext context, final String key) { return context.getMergedJobDataMap().get(key); }
Cast the object to the original one with the type. The object must extend Serializable.
getKey
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/AbstractQuartzJob.java
Apache-2.0
public String getJobName() { return jobName; }
This check is necessary for raw type. Please see test {@link QuartzJobDescriptionTest#testCreateQuartzJobDescription2}
getJobName
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
Apache-2.0
public Class<? extends AbstractQuartzJob> getJobClass() { return this.jobClass; }
This check is necessary for raw type. Please see test {@link QuartzJobDescriptionTest#testCreateQuartzJobDescription2}
getJobClass
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
Apache-2.0
public Map<String, ? extends Serializable> getContextMap() { return this.contextMap; }
This check is necessary for raw type. Please see test {@link QuartzJobDescriptionTest#testCreateQuartzJobDescription2}
getContextMap
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
Apache-2.0
@Override public String toString() { return "QuartzJobDescription{" + "jobClass=" + this.jobClass + ", groupName='" + this.groupName + '\'' + ", contextMap=" + this.contextMap + '}'; }
This check is necessary for raw type. Please see test {@link QuartzJobDescriptionTest#testCreateQuartzJobDescription2}
toString
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
Apache-2.0
public String getGroupName() { return this.groupName; }
This check is necessary for raw type. Please see test {@link QuartzJobDescriptionTest#testCreateQuartzJobDescription2}
getGroupName
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzJobDescription.java
Apache-2.0
public void start() throws SchedulerException { this.scheduler.start(); logger.info("Quartz Scheduler started."); }
Manages Quartz schedules. Azkaban regards QuartzJob and QuartzTrigger as an one-to-one mapping. Quartz job key naming standard: Job key is composed of job name and group name. Job type denotes job name. Project id+flow name denotes group name. E.x FLOW_TRIGGER as job name, 1.flow1 as group name
start
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
@VisibleForTesting void cleanup() throws SchedulerException { this.scheduler.clear(); }
Manages Quartz schedules. Azkaban regards QuartzJob and QuartzTrigger as an one-to-one mapping. Quartz job key naming standard: Job key is composed of job name and group name. Job type denotes job name. Project id+flow name denotes group name. E.x FLOW_TRIGGER as job name, 1.flow1 as group name
cleanup
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public void shutdown() throws SchedulerException { this.scheduler.shutdown(); logger.info("Quartz Scheduler shut down."); }
Manages Quartz schedules. Azkaban regards QuartzJob and QuartzTrigger as an one-to-one mapping. Quartz job key naming standard: Job key is composed of job name and group name. Job type denotes job name. Project id+flow name denotes group name. E.x FLOW_TRIGGER as job name, 1.flow1 as group name
shutdown
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public synchronized boolean pauseJobIfPresent(final String jobName, final String groupName) throws SchedulerException { if (ifJobExist(jobName, groupName)) { this.scheduler.pauseJob(new JobKey(jobName, groupName)); return true; } else { return false; } }
Pause a job if it's present. @param jobName @param groupName @return true if job has been paused, no if job doesn't exist. @throws SchedulerException
pauseJobIfPresent
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public synchronized boolean isJobPaused(final String jobName, final String groupName) throws SchedulerException { if (!ifJobExist(jobName, groupName)) { throw new SchedulerException(String.format("Job (job name %s, group name %s) doesn't " + "exist'", jobName, groupName)); } final JobK...
Check if job is paused. @return true if job is paused, false otherwise.
isJobPaused
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public synchronized boolean resumeJobIfPresent(final String jobName, final String groupName) throws SchedulerException { if (ifJobExist(jobName, groupName)) { this.scheduler.resumeJob(new JobKey(jobName, groupName)); return true; } else { return false; } }
Resume a job. @param jobName @param groupName @return true the job has been resumed, no if the job doesn't exist. @throws SchedulerException
resumeJobIfPresent
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public synchronized boolean unscheduleJob(final String jobName, final String groupName) throws SchedulerException { return this.scheduler.deleteJob(new JobKey(jobName, groupName)); }
Unschedule a job. @param jobName @param groupName @return true if job is found and unscheduled. @throws SchedulerException
unscheduleJob
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public synchronized boolean scheduleJobIfAbsent(final String cronExpression, final QuartzJobDescription jobDescription) throws SchedulerException { requireNonNull(jobDescription, "jobDescription is null"); if (ifJobExist(jobDescription.getJobName(), jobDescription.getGroupName())) { logger.warn(St...
Only cron schedule register is supported. Since register might be called when concurrently uploading projects, so synchronized is added to ensure thread safety. @param cronExpression the cron schedule for this job @param jobDescription Regarding QuartzJobDescription#groupName, in order to guarantee no duplicate quartz...
scheduleJobIfAbsent
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
@VisibleForTesting boolean ifJobExist(final String jobName, final String groupName) throws SchedulerException { return this.scheduler.getJobDetail(new JobKey(jobName, groupName)) != null; }
Only cron schedule register is supported. Since register might be called when concurrently uploading projects, so synchronized is added to ensure thread safety. @param cronExpression the cron schedule for this job @param jobDescription Regarding QuartzJobDescription#groupName, in order to guarantee no duplicate quartz...
ifJobExist
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
public Scheduler getScheduler() { return this.scheduler; }
Only cron schedule register is supported. Since register might be called when concurrently uploading projects, so synchronized is added to ensure thread safety. @param cronExpression the cron schedule for this job @param jobDescription Regarding QuartzJobDescription#groupName, in order to guarantee no duplicate quartz...
getScheduler
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/QuartzScheduler.java
Apache-2.0
@Override public Job newJob(final TriggerFiredBundle bundle, final Scheduler scheduler) throws SchedulerException { return (Job) this.injector.getInstance(bundle.getJobDetail() .getJobClass()); }
Produce Guice-able Job in this custom defined Job Factory. In order to allow Quaratz jobs easily inject dependency, we create this factory. Every Quartz job will be constructed by newJob method.
newJob
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/scheduler/SchedulerJobFactory.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/scheduler/SchedulerJobFactory.java
Apache-2.0
@Override public void doFilter( final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { final HttpServletRequest req = (HttpServletRequest) request; final String requestURI = req.getRequestURI(); final AbstractA...
Servlet filter in charge of recording all api endpoint metrics.
doFilter
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
@Override public void init(final FilterConfig filterConfig) { this.filterConfig = filterConfig; }
Servlet filter in charge of recording all api endpoint metrics.
init
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
@Override public void destroy() { this.filterConfig = null; }
Servlet filter in charge of recording all api endpoint metrics.
destroy
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
private void recordMetrics( final FilterChain chain, final HttpServletRequest request, final ServletResponse response, final AbstractAzkabanServlet servlet) throws IOException, ServletException { final long startTime = System.currentTimeMillis(); final Optional<AzkabanAPI> action = servl...
Servlet filter in charge of recording all api endpoint metrics.
recordMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
private void recordOnlyAuthenticationMetrics( final FilterChain chain, final HttpServletRequest request, final ServletResponse response, final LoginAbstractAzkabanServlet servlet) throws IOException, ServletException { final long startTime = System.currentTimeMillis(); final AzkabanAPI l...
Servlet filter in charge of recording all api endpoint metrics.
recordOnlyAuthenticationMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
protected void recordOriginMetrics(final HttpServletRequest request, final AzkabanAPI api) { final AzkabanAPIMetrics metrics = api.getMetrics(); final String reqOrigin = request.getHeader(HTTP_HEADER_AZKABAN_TRACE_ORIGIN); final boolean isReqFromWebApp = HTTP_HEADER_VALUE_AZKABAN_TRACE_ORIGIN.equals(reqOrig...
Servlet filter in charge of recording all api endpoint metrics.
recordOriginMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/APIMetricsFilter.java
Apache-2.0
@Deprecated public static AzkabanWebServer getInstance() { return app; }
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
getInstance
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public static void main(final String[] args) throws Exception { // Redirect all std out and err messages into log4j StdOutErrRedirect.redirectOutAndErrToLog(); logger.info("Starting Jetty Azkaban Web Server..."); final Props props = AzkabanServer.loadProps(args); if (props == null) { logger....
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
main
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public static void launch(final AzkabanWebServer webServer) throws Exception { /* This creates the Web Server instance */ app = webServer; webServer.validateDatabaseVersion(); webServer.prepareAndStartServer(); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
launch
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public void run() { try { if (webServer.props.getBoolean(ENABLE_QUARTZ, false)) { AzkabanWebServer.logger.info("Shutting down flow trigger scheduler..."); webServer.flowTriggerScheduler.shutdown(); } } catch (final Exception e) { Azka...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
run
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public void logTopMemoryConsumers() throws Exception { if (new File("/bin/bash").exists() && new File("/bin/ps").exists() && new File("/usr/bin/head").exists()) { AzkabanWebServer.logger.info("logging top memory consumer"); final java.lang.ProcessBuilder processBuilder = ...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
logTopMemoryConsumers
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private static void loadViewerPlugins(final Context root, final String pluginPath, final VelocityEngine ve) { final File viewerPluginPath = new File(pluginPath); if (!viewerPluginPath.exists()) { return; } final ClassLoader parentLoader = AzkabanWebServer.class.getClassLoader(); final F...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
loadViewerPlugins
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public FlowTriggerService getFlowTriggerService() { return this.flowTriggerService; }
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
getFlowTriggerService
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public FlowTriggerScheduler getFlowTriggerScheduler() { return this.flowTriggerScheduler; }
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
getFlowTriggerScheduler
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void validateDatabaseVersion() throws IOException, SQLException { final boolean checkDB = this.props .getBoolean(AzkabanDatabaseSetup.DATABASE_CHECK_VERSION, false); if (checkDB) { final AzkabanDatabaseSetup setup = new AzkabanDatabaseSetup(this.props); setup.loadTableInfo(); i...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
validateDatabaseVersion
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void configureRoutes() throws TriggerManagerException { final Context root = new Context(this.server, "/", Context.SESSIONS); root.setMaxFormContentSize(MAX_FORM_CONTENT_SIZE); root.setAttribute(AZKABAN_SERVLET_CONTEXT_KEY, this); final String staticDir = this.props.getString("web.resource.dir"...
The Azkaban Jetty server class <p> Global azkaban properties for setup. All of them are optional unless otherwise marked: azkaban.name - The displayed name of this instance. azkaban.label - Short descriptor of this Azkaban instance. azkaban.color - Theme color azkaban.temp.dir - Temp dir used by Azkaban for various fil...
configureRoutes
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@VisibleForTesting protected Map<String, AbstractAzkabanServlet> getRoutesMap() { final String defaultServletPath = this.props.getString("azkaban.default.servlet.path", "/index"); final Map<String, AbstractAzkabanServlet> routesMap = new HashMap<>(); routesMap.put("/index", new ProjectServlet());...
@return The routing map of path to servlets.
getRoutesMap
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private boolean isContainerizedDispatchMethodEnabled() { return DispatchMethod.isContainerizedMethodEnabled(this.props .getString(Constants.ConfigurationKeys.AZKABAN_EXECUTION_DISPATCH_METHOD, DispatchMethod.PUSH.name())); }
@return True if the Containerization is enabled, otherwise false.
isContainerizedDispatchMethodEnabled
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void prepareAndStartServer() throws Exception { this.executorManagerAdapter.start(); this.executionLogsCleaner.start(); this.missedSchedulesManager.start(); configureRoutes(); startWebMetrics(); startContainerMetrics(); this.containerCleanupManager.ifPresent(ContainerCleanupManager:...
@return True if the Containerization is enabled, otherwise false.
prepareAndStartServer
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void startWebMetrics() { final QueuedThreadPool queuedThreadPool = (QueuedThreadPool) this.server.getThreadPool(); final ExecutorManagerAdapter executorManagerAdapter = this.executorManagerAdapter; final SessionCache sessionCache = this.sessionCache; final int minAgeForClassifyingAFlowAged = th...
@return True if the Containerization is enabled, otherwise false.
startWebMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public int getNumberOfIdleServerThreads() { // The number of idle threads in Jetty thread pool return queuedThreadPool.getIdleThreads(); }
@return True if the Containerization is enabled, otherwise false.
getNumberOfIdleServerThreads
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public int getNumberOfServerThreads() { // The number of threads in Jetty thread pool. The formula is: // threads = idleThreads + busyThreads return queuedThreadPool.getThreads(); }
@return True if the Containerization is enabled, otherwise false.
getNumberOfServerThreads
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public int getServerJobsQueueSize() { // The number of requests queued in the Jetty thread pool. return queuedThreadPool.getQueueSize(); }
@return True if the Containerization is enabled, otherwise false.
getServerJobsQueueSize
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public long getNumberOfQueuedFlows() { return executorManagerAdapter.getQueuedFlowSize(); }
@return True if the Containerization is enabled, otherwise false.
getNumberOfQueuedFlows
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public int getNumberOfRunningFlows() { /* * TODO: Currently {@link ExecutorManager#getRunningFlows()} includes both running and * non-dispatched flows. Originally we would like to do a subtraction between * getRunningFlows and {@link ExecutorManager#getQueuedFlowSize()...
@return True if the Containerization is enabled, otherwise false.
getNumberOfRunningFlows
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public long getNumberOfCurrentSessions() { // Metric for flows that have been submitted, but haven't started for more than N minutes // (N is configurable by MIN_AGE_FOR_CLASSIFYING_A_FLOW_AGED_MINUTES). return sessionCache.getSessionCount(); }
@return True if the Containerization is enabled, otherwise false.
getNumberOfCurrentSessions
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public long getNumberOfAgedQueuedFlows() { return executorManagerAdapter.getAgedQueuedFlowSize(); }
@return True if the Containerization is enabled, otherwise false.
getNumberOfAgedQueuedFlows
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void startContainerMetrics() { this.containerizationMetrics.setUp(); this.containerizationMetrics.startReporting(this.props); }
Set up and start reporting container metrics
startContainerMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
private void loadBuiltinCheckersAndActions() { logger.info("Loading built-in checker and action types"); ExecuteFlowAction.setExecutorManager(this.executorManagerAdapter); ExecuteFlowAction.setProjectManager(this.projectManager); ExecuteFlowAction.setTriggerManager(this.triggerManager); KillExecutio...
Set up and start reporting container metrics
loadBuiltinCheckersAndActions
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public VelocityEngine getVelocityEngine() { return this.velocityEngine; }
Returns the velocity engine for pages to use.
getVelocityEngine
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Override public UserManager getUserManager() { return this.userManager; }
Returns the velocity engine for pages to use.
getUserManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public ProjectManager getProjectManager() { return this.projectManager; }
Returns the velocity engine for pages to use.
getProjectManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public ExecutorManagerAdapter getExecutorManager() { return this.executorManagerAdapter; }
Returns the velocity engine for pages to use.
getExecutorManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public ScheduleManager getScheduleManager() { return this.scheduleManager; }
Returns the velocity engine for pages to use.
getScheduleManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public TriggerManager getTriggerManager() { return this.triggerManager; }
Returns the velocity engine for pages to use.
getTriggerManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
public WebMetrics getWebMetrics() { return this.webMetrics; }
Returns the velocity engine for pages to use.
getWebMetrics
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServer.java
Apache-2.0
@Provides @Singleton public FlowTriggerDependencyPluginManager getDependencyPluginManager(final Props props) throws FlowTriggerDependencyPluginException { //todo chengren311: disable requireNonNull for now in beta since dependency plugin dir is not // required. Add it back when flow trigger feature is...
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
getDependencyPluginManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Override protected void configure() { bind(Server.class).toProvider(WebServerProvider.class); bind(ScheduleLoader.class).to(TriggerBasedScheduleLoader.class); bind(FlowTriggerInstanceLoader.class).to(JdbcFlowTriggerInstanceLoaderImpl.class); bind(ExecutorManagerAdapter.class).to(resolveExecutorManage...
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
configure
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private Class<? extends ContainerizationMetrics> resolveContainerMetricsClass() { return isContainerizedDispatchMethodEnabled() ? ContainerizationMetricsImpl.class : DummyContainerizationMetricsImpl.class; }
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
resolveContainerMetricsClass
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private Class<? extends EventListener> resolveEventListenerClass() { return FlowStatusChangeEventListener.class; }
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
resolveEventListenerClass
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private Class<? extends ContainerizedImpl> resolveContainerizedImpl() { final String containerizedImplProperty = props.getString(ContainerizedDispatchManagerProperties.CONTAINERIZED_IMPL_TYPE, ContainerizedImplType.KUBERNETES.name()) .toUpperCase(); return ContainerizedImplType.v...
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
resolveContainerizedImpl
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private Class<? extends ExecutorManagerAdapter> resolveExecutorManagerAdaptorClassType() { switch (DispatchMethod.getDispatchMethod(this.props .getString(Constants.ConfigurationKeys.AZKABAN_EXECUTION_DISPATCH_METHOD, DispatchMethod.PUSH.name()))) { case POLL: return ExecutionContro...
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
resolveExecutorManagerAdaptorClassType
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private Class<? extends WebMetrics> resolveWebMetricsClass() { return this.props.getBoolean(ConfigurationKeys.IS_METRICS_ENABLED, false) ? WebMetricsImpl.class : DummyWebMetricsImpl.class; }
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
resolveWebMetricsClass
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private void bindImageManagementDependencies() { if(isContainerizedDispatchMethodEnabled()) { bind(ImageTypeService.class).to(ImageTypeServiceImpl.class).in(Scopes.SINGLETON); bind(ImageVersionService.class).to(ImageVersionServiceImpl.class).in(Scopes.SINGLETON); bind(ImageRampupService.class).to(...
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
bindImageManagementDependencies
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private boolean isContainerizedDispatchMethodEnabled() { return DispatchMethod.isContainerizedMethodEnabled(props .getString(Constants.ConfigurationKeys.AZKABAN_EXECUTION_DISPATCH_METHOD, DispatchMethod.PUSH.name())); }
This Guice module is currently a one place container for all bindings in the current module. This is intended to help during the migration process to Guice. Once this class starts growing we can move towards more modular structuring of Guice components.
isContainerizedDispatchMethodEnabled
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private void bindContainerWatchDependencies() { if(!isContainerizedDispatchMethodEnabled()) { bind(ContainerizedImpl.class).toProvider(Providers.of(null)); return; } log.info("Binding kubernetes watch dependencies"); bind(KubernetesWatch.class).in(Scopes.SINGLETON); }
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
bindContainerWatchDependencies
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private void bindContainerCleanupManager() { if(!isContainerizedDispatchMethodEnabled()) { bind(ContainerCleanupManager.class).toProvider(Providers.of(null)); return; } log.info("Binding ContainerCleanupManager"); bind(ContainerCleanupManager.class).in(Scopes.SINGLETON); }
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
bindContainerCleanupManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private void bindExecutorHealthCheckerForContainerization() { // {@link azkaban.executor.ExecutorHealthChecker} binding should only happen if // {@link azkaban.DispatchMethod.CONTAINERIZED} dispatch model is enabled and below properties are defined. if(isContainerizedDispatchMethodEnabled()) { if(!thi...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
bindExecutorHealthCheckerForContainerization
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
private void bindOnExecutionEventListener() { if(!isContainerizedDispatchMethodEnabled()) { bind(OnExecutionEventListener.class).toProvider(Providers.of(null)); return; } log.info("Binding OnExecutionEventListener"); bind(OnExecutionEventListener.class).to(OnContainerizedExecutionEventListen...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
bindOnExecutionEventListener
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Singleton @Provides private RawPodWatchEventListener createStatusDrivingListener(final Props azkProps, @Named(FLOW_POD_MONITOR) AzPodStatusListener flowPodMonitorListener, @Named(CONTAINER_STATUS_METRICS_HANDLER) AzPodStatusListener containerStatusMetricsHandlerListener) { AzPodStatusDriv...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createStatusDrivingListener
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Named(FLOW_POD_MONITOR) @Singleton @Provides private AzPodStatusListener createFlowPodMonitoringListener( final Props azkProps, final ProjectManager projectManager, final ContainerizedImpl containerizedImpl, final ExecutorLoader executorLoader, final AlerterHolder alerterH...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createFlowPodMonitoringListener
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Named(CONTAINER_STATUS_METRICS_HANDLER) @Singleton @Provides private AzPodStatusListener createContainerStatusMetricsHandlerListener( ContainerizationMetrics containerizationMetrics) { return new ContainerStatusMetricsListener(containerizationMetrics); }
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createContainerStatusMetricsHandlerListener
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Singleton @Provides private ApiClient createContainerApiClient(final Props azkProps) { return WatchUtils.createApiClient(azkProps); }
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createContainerApiClient
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Singleton @Provides private PodWatchParams createPodWatchParams(final Props azkProps) { return WatchUtils.createPodWatchParams(azkProps); }
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createPodWatchParams
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Singleton @Provides public UserManager createUserManager(final Props props) { final Class<?> userManagerClass = props.getClass(USER_MANAGER_CLASS_PARAM, null); final UserManager manager; if (userManagerClass != null && userManagerClass.getConstructors().length > 0) { log.info("Loading u...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createUserManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
@Inject @Singleton @Provides public VelocityEngine createVelocityEngine(final Props props) { final boolean devMode = props.getBoolean(VELOCITY_DEV_MODE_PARAM, false); final VelocityEngine engine = new VelocityEngine(); engine.setProperty("resource.loader", "classpath, jar"); engine.setProperty("c...
Binds container watch dependencies based on the dispatch method. Hack Alert: This binding to a 'null' provider in the if-condition is hacky. This was a required to satisfy the {@code ContainerizedImpl} dependency when the dispatch method is not containerized. The field is injected in one of the listener providing ...
createVelocityEngine
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/AzkabanWebServerModule.java
Apache-2.0
public Map<Integer, Executor> getExecutorStatusMap() { return executorStatusMap; }
This POJO is used by GSON library to create a status JSON object. This class represents status for azkaban cluster.
getExecutorStatusMap
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/ClusterStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/ClusterStatus.java
Apache-2.0
public Map<String, ImageVersionMetadataResponseDTO> getImageTypeVersionMap() { return imageTypeVersionMap; }
This POJO is used by GSON library to create a status JSON object. This class represents status for containerized cluster.
getImageTypeVersionMap
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/ContainerizedClusterStatus.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/ContainerizedClusterStatus.java
Apache-2.0
public String getCSRFTokenFromSession(Session session) { if (null == session || StringUtils.isEmpty(session.getSessionId())) { return null; } String sessionId = session.getSessionId(); return getCSRFTokenFromSessionId(sessionId); }
@param session containing session-id @return CSRF token derived from session-id
getCSRFTokenFromSession
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
private String getCSRFTokenFromSessionId(String sessionId) { byte[] bytes; try { bytes = sessionId.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { logger.info("Unable to convert sessionId to bytes", e); return null; } byte[] hashedSessionId = this.hashFunction.doFinal...
@param sessionId @return CSRF token derived from session-id
getCSRFTokenFromSessionId
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
private static byte[] getSecretKey() { Random randomGen = new Random(); byte[] secretKey = new byte[8]; randomGen.nextBytes(secretKey); return secretKey; }
@return Eight bytes SecretKey to be used for initializing HmacSHA256
getSecretKey
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
private void initHashFunction() throws NoSuchAlgorithmException, InvalidKeyException { byte[] secretKey = getSecretKey(); initHashFunction(secretKey); }
@return Eight bytes SecretKey to be used for initializing HmacSHA256
initHashFunction
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
private void initHashFunction(byte[] secretKey) throws NoSuchAlgorithmException, InvalidKeyException { Mac mac = Mac.getInstance(ALGORITHM); SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey, ALGORITHM); mac.init(secretKeySpec); this.hashFunction = mac; }
@return Eight bytes SecretKey to be used for initializing HmacSHA256
initHashFunction
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
public boolean validateCSRFToken(String sessionId, String csrfTokenFromRequest) { String csrfTokenFromSessionId = getCSRFTokenFromSessionId(sessionId); if (StringUtils.isEmpty(csrfTokenFromSessionId)) { return false; } return csrfTokenFromRequest.equals(csrfTokenFromSessionId); }
@param sessionId @param csrfTokenFromRequest @return True if the csrfTokenFromRequest matches with the CSRFToken generated from session-id, otherwise false
validateCSRFToken
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/CSRFTokenUtility.java
Apache-2.0
public String getVersion() { return version; }
This is an abstract class for representing azkaban common status.
getVersion
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public String getPid() { return pid; }
This is an abstract class for representing azkaban common status.
getPid
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public String getInstallationPath() { return installationPath; }
This is an abstract class for representing azkaban common status.
getInstallationPath
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public long getUsedMemory() { return usedMemory; }
This is an abstract class for representing azkaban common status.
getUsedMemory
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public long getXmx() { return xmx; }
This is an abstract class for representing azkaban common status.
getXmx
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public boolean isDatabaseUp() { return isDatabaseUp; }
This is an abstract class for representing azkaban common status.
isDatabaseUp
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/Status.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/Status.java
Apache-2.0
public Status getStatus() { if (isContainerizedDispatchMethodEnabled()) { return getContainerizedStatus(); } return getClusterStatus(); }
Gets the status of the azkaban cluster. @return Status
getStatus
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
private Status getClusterStatus() { // Build the status object return new ClusterStatus(getVersion(), getPid(), getInstallationPath(), getUsedMemory(), getMaxMemory(), getDbStatus(), getActiveExecutors()); }
This returns implementation instance for Status containing status information for Azkaban cluster pertaining to web server, memory, active executors etc. @return Status
getClusterStatus
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
private Status getContainerizedStatus() { // Build the status object ContainerizedDispatchManager containerizedDispatchManager = getContainerizedDispatchManager(); return new ContainerizedClusterStatus(getVersion(), getPid(), getInstallationPath(), getUsedMemory(), getMaxMemo...
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getContainerizedStatus
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
@VisibleForTesting long getUsedMemory() { final Runtime runtime = Runtime.getRuntime(); return runtime.totalMemory() - runtime.freeMemory(); }
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getUsedMemory
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
@VisibleForTesting long getMaxMemory() { final Runtime runtime = Runtime.getRuntime(); return runtime.maxMemory(); }
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getMaxMemory
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
private Map<String, ImageVersionMetadataResponseDTO> getStringImageVersionMetadataResponseDTOMap() { Map<String, ImageVersionMetadataResponseDTO> imageTypeVersionMap = new TreeMap<>(); try { imageTypeVersionMap = this.getImageVersionMetadataService(). getVersionMetadataForAllImageT...
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getStringImageVersionMetadataResponseDTOMap
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
@VisibleForTesting String getVersion() { return jarVersion == null ? "unknown" : jarVersion; }
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getVersion
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
private ImageVersionMetadataService getImageVersionMetadataService() { return SERVICE_PROVIDER.getInstance(ImageVersionMetadataService.class); }
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getImageVersionMetadataService
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0
private ContainerizedDispatchManager getContainerizedDispatchManager() { return (ContainerizedDispatchManager) SERVICE_PROVIDER .getInstance(ExecutorManagerAdapter.class); }
This returns implementation instance for Status containing cluster status information for Azkaban containerization. It includes information pertaining to web server, memory and containerization information such as image types and version for each image types selected based on either random rampup or latest active image...
getContainerizedDispatchManager
java
azkaban/azkaban
azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
https://github.com/azkaban/azkaban/blob/master/azkaban-web-server/src/main/java/azkaban/webapp/StatusService.java
Apache-2.0