Package azkaban.app

Examples of azkaban.app.AzkabanApplication


     *
     * @param config The ServletConfig
     * @return The app
     */
    public static AzkabanApplication getApp(ServletConfig config) {
        AzkabanApplication app = (AzkabanApplication) config.getServletContext()
                                            .getAttribute(AzkabanServletContextListener.AZKABAN_SERVLET_CONTEXT_KEY);
        if(app == null)
            throw new IllegalStateException("No batch application is defined in the servlet context!");
        else
            return app;
View Full Code Here


        try {
            File logDir = new File(homeDir, "logs");
            File jobDir = new File(homeDir, "jobs");
            File tempDir = new File(homeDir, "temp");

            this.app = new AzkabanApplication(Collections.singletonList(jobDir), logDir, tempDir, false);
        } catch(IOException e) {
            throw new IllegalArgumentException(e);
        }

        event.getServletContext().setAttribute(AZKABAN_SERVLET_CONTEXT_KEY, this.app);
View Full Code Here

    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
            IOException {
        /* set runtime properties from request and response */
        super.setRuntimeProperties(req, resp);

        AzkabanApplication app = getApplication();
        @SuppressWarnings("unused")
        Map<String, JobDescriptor> descriptors = app.getJobManager().loadJobDescriptors();
        Page page = newPage(req, resp, "azkaban/web/pages/index.vm");
        page.add("logDir", app.getLogDirectory());
        page.add("flows", app.getAllFlows());
        page.add("scheduled", app.getScheduleManager().getSchedule());
        page.add("executing", app.getJobExecutorManager().getExecutingJobs());
        page.add("completed", app.getJobExecutorManager().getCompleted());
        page.add("rootJobNames", app.getAllFlows().getRootFlowNames());
        page.add("folderNames", app.getAllFlows().getFolders());
        page.add("jobDescComparator", JobDescriptor.NAME_COMPARATOR);
        page.render();
    }
View Full Code Here

            throw new ServletException("No job file found!");

        Map<String, Object> params = this._multipartParser.parseMultipart(request);

        try {
            final AzkabanApplication app = getApplication();
            final JobManager jobManager = app.getJobManager();

            FileItem item = (FileItem) params.get("file");
            String deployPath = (String) params.get("path");
            File jobDir = unzipFile(item);
View Full Code Here

            throws ServletException, IOException {

        /* set runtime properties from request and response */
        super.setRuntimeProperties(req, resp);

        AzkabanApplication app = getApplication();
        String action = getParam(req, "action");
        if ("loadjobs".equals(action)) {
          resp.setContentType("application/json");
          String folder = getParam(req, "folder");
          resp.getWriter().print(getJSONJobsForFolder(app.getAllFlows(), folder));
          resp.getWriter().flush();
          return;
        }
        else if("unschedule".equals(action)) {
            String jobid = getParam(req, "job");
            app.getScheduleManager().removeScheduledJob(jobid);
        } else if("cancel".equals(action)) {
            cancelJob(app, req);
        } else if("schedule".equals(action)) {
            String redirect = scheduleJobs(app, req, resp);
            if (!redirect.isEmpty()) {
View Full Code Here

    private static final Logger logger = Logger.getLogger(JobDetailServlet.class);

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
            IOException {
        AzkabanApplication app = getApplication();
        String jobId = req.getParameter("id");
        JobManager jobManager = app.getJobManager();
        Map<String, JobDescriptor> descriptors = jobManager.loadJobDescriptors();
        boolean isEditing = req.getParameter("edit") != null;
        if(jobId == null) {
            Page page = newPage(req, resp, "azkaban/web/pages/edit_job.vm");
            page.add("jsonData", getJSONText(new Props()));
View Full Code Here

    String id = getParam(req, "id");
        resp.setContentType("application/json");
    boolean ignoreDeps = !Boolean.parseBoolean(getParam(req, "include_deps"));
    PrintWriter writer = resp.getWriter();
   
        AzkabanApplication app = getApplication();
    HashMap<String, Object> results = new HashMap<String, Object>();
    try {
          app.getJobExecutorManager().execute(id, ignoreDeps);
          results.put("success", "Running " + id + (ignoreDeps ? " without dependencies." : " with dependencies."));
        }
        catch (JobExecutionException e) {
          results.put("error", e.getMessage());
        }
View Full Code Here

    @SuppressWarnings("unchecked")
  @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        AzkabanApplication app = getApplication();
       
        JobManager jobManager = app.getJobManager();
        String jobName = req.getParameter("job_name");
        String jobPath = req.getParameter("job_path");
        Map<String, String> props = new HashMap<String, String>();
        for(int i = 0;; i++) {
            String key = req.getParameter("key" + i);
View Full Code Here

TOP

Related Classes of azkaban.app.AzkabanApplication

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.