Examples of BundleEngine


Examples of org.apache.oozie.BundleEngine

                throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303,
                        RestConstants.ACTION_PARAM, action);
            }
            boolean startJob = (action != null);
            String user = conf.get(OozieClient.USER_NAME);
            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(user,
                    getAuthToken(request));
            String id = null;
            boolean dryrun = false;
            if (action != null) {
                dryrun = (action.equals(RestConstants.JOB_ACTION_DRYRUN));
            }
            if (dryrun) {
                id = bundleEngine.dryrunSubmit(conf, startJob);
            }
            else {
                id = bundleEngine.submitJob(conf, startJob);
            }
            json.put(JsonTags.JOB_ID, id);
        }
        catch (BundleEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
View Full Code Here

Examples of org.apache.oozie.BundleEngine

            int start = (startStr != null) ? Integer.parseInt(startStr) : 1;
            start = (start < 1) ? 1 : start;
            int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
            len = (len < 1) ? 50 : len;

            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                    getAuthToken(request));
            BundleJobInfo jobs = bundleEngine.getBundleJobs(filter, start, len);
            List<BundleJobBean> jsonJobs = jobs.getBundleJobs();

            json.put(JsonTags.BUNDLE_JOBS, BundleJobBean.toJSONArray(jsonJobs));
            json.put(JsonTags.BUNDLE_JOB_TOTAL, jobs.getTotal());
            json.put(JsonTags.BUNDLE_JOB_OFFSET, jobs.getStart());
View Full Code Here

Examples of org.apache.oozie.BundleEngine

                throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303,
                        RestConstants.ACTION_PARAM, action);
            }
            boolean startJob = (action != null);
            String user = conf.get(OozieClient.USER_NAME);
            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(user,
                    getAuthToken(request));
            String id = null;
            boolean dryrun = false;
            if (action != null) {
                dryrun = (action.equals(RestConstants.JOB_ACTION_DRYRUN));
            }
            if (dryrun) {
                id = bundleEngine.dryRunSubmit(conf);
            }
            else {
                id = bundleEngine.submitJob(conf, startJob);
            }
            json.put(JsonTags.JOB_ID, id);
        }
        catch (BundleEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
View Full Code Here

Examples of org.apache.oozie.BundleEngine

            int start = (startStr != null) ? Integer.parseInt(startStr) : 1;
            start = (start < 1) ? 1 : start;
            int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
            len = (len < 1) ? 50 : len;

            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                    getAuthToken(request));
            BundleJobInfo jobs = bundleEngine.getBundleJobs(filter, start, len);
            List<BundleJobBean> jsonJobs = jobs.getBundleJobs();

            json.put(JsonTags.BUNDLE_JOBS, BundleJobBean.toJSONArray(jsonJobs, timeZoneId));
            json.put(JsonTags.BUNDLE_JOB_TOTAL, jobs.getTotal());
            json.put(JsonTags.BUNDLE_JOB_OFFSET, jobs.getStart());
View Full Code Here

Examples of org.apache.oozie.BundleEngine

            int start = (startStr != null) ? Integer.parseInt(startStr) : 1;
            start = (start < 1) ? 1 : start;
            int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
            len = (len < 1) ? 50 : len;

            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                    getAuthToken(request));
            BulkResponseInfo bulkResponse = bundleEngine.getBulkJobs(bulkFilter, start, len);
            List<BulkResponseImpl> jsonResponse = bulkResponse.getResponses();

            json.put(JsonTags.BULK_RESPONSES, BulkResponseImpl.toJSONArray(jsonResponse, timeZoneId));
            json.put(JsonTags.BULK_RESPONSE_TOTAL, bulkResponse.getTotal());
            json.put(JsonTags.BULK_RESPONSE_OFFSET, bulkResponse.getStart());
View Full Code Here

Examples of org.apache.oozie.BundleEngine

                throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ErrorCode.E0303,
                        RestConstants.ACTION_PARAM, action);
            }
            boolean startJob = (action != null);
            String user = conf.get(OozieClient.USER_NAME);
            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(user,
                    getAuthToken(request));
            String id = null;
            boolean dryrun = false;
            if (action != null) {
                dryrun = (action.equals(RestConstants.JOB_ACTION_DRYRUN));
            }
            if (dryrun) {
                id = bundleEngine.dryrunSubmit(conf, startJob);
            }
            else {
                id = bundleEngine.submitJob(conf, startJob);
            }
            json.put(JsonTags.JOB_ID, id);
        }
        catch (BundleEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
View Full Code Here

Examples of org.apache.oozie.BundleEngine

            int start = (startStr != null) ? Integer.parseInt(startStr) : 1;
            start = (start < 1) ? 1 : start;
            int len = (lenStr != null) ? Integer.parseInt(lenStr) : 50;
            len = (len < 1) ? 50 : len;

            BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                    getAuthToken(request));
            BundleJobInfo jobs = bundleEngine.getBundleJobs(filter, start, len);
            List<BundleJobBean> jsonJobs = jobs.getBundleJobs();

            json.put(JsonTags.BUNDLE_JOBS, BundleJobBean.toJSONArray(jsonJobs));
            json.put(JsonTags.BUNDLE_JOB_TOTAL, jobs.getTotal());
            json.put(JsonTags.BUNDLE_JOB_OFFSET, jobs.getStart());
View Full Code Here

Examples of org.apache.oozie.BundleEngine

        assertEquals(Job.Status.SUCCEEDED, action2.getStatus());

        Runnable purgeRunnable = new PurgeRunnable(1, 1, 1, 100);
        purgeRunnable.run();

        final BundleEngine engine = new BundleEngine("u", "a");
        waitFor(10000, new Predicate() {
            public boolean evaluate() throws Exception {
                try {
                    engine.getBundleJob(jobId).getStatus();
                }
                catch (Exception ex) {
                    return true;
                }
                return false;
View Full Code Here

Examples of org.apache.oozie.BundleEngine

     * @param request servlet request
     * @param response servlet response
     * @throws XServletException
     */
    private void startBundleJob(HttpServletRequest request, HttpServletResponse response) throws XServletException {
        BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                getAuthToken(request));
        String jobId = getResourceName(request);
        try {
            bundleEngine.start(jobId);
        }
        catch (BundleEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
        }
    }
View Full Code Here

Examples of org.apache.oozie.BundleEngine

     * @param request servlet request
     * @param response servlet response
     * @throws XServletException
     */
    private void resumeBundleJob(HttpServletRequest request, HttpServletResponse response) throws XServletException {
        BundleEngine bundleEngine = Services.get().get(BundleEngineService.class).getBundleEngine(getUser(request),
                getAuthToken(request));
        String jobId = getResourceName(request);
        try {
            bundleEngine.resume(jobId);
        }
        catch (BundleEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.