Package org.apache.oozie

Examples of org.apache.oozie.BulkResponseInfo


        List<String> coordIds = jpaService.execute(new CoordJobsGetFromParentIdJPAExecutor(bundleId, 10));

        // there are 3 coordinators but giving range as only two of them
        String coordIdsStr = coordIds.get(0) + "," + coordIds.get(1);
        String request = "bundle=" + bundleId + ";coordinators=" + coordIdsStr + ";actionstatus=KILLED";
        BulkResponseInfo response = _execQuery(request);
        List<BulkResponseImpl> brList = response.getResponses();
        assertEquals(2, brList.size()); // 2 actions satisfy the conditions
        assertEquals(2, response.getTotal());
        assertEquals(brList.get(0).getAction().getId(), "Coord1@2");
        assertEquals(brList.get(1).getAction().getId(), "Coord2@1");
    }
View Full Code Here


        assertEquals(brList.get(1).getAction().getId(), "Coord2@1");
    }

    private BulkResponseInfo _execQuery(String request) throws JPAExecutorException, BundleEngineException {
        BulkJPAExecutor bulkjpa = new BulkJPAExecutor(BundleEngine.parseBulkFilter(request), 1, 10);
        BulkResponseInfo response = jpaService.execute(bulkjpa);
        assertNotNull(response);
        return response;
    }
View Full Code Here

            jpaService.execute(bundleInsertjpa);
            addCoordForBulkMonitor(bundleId);
            String request = "bundle=" + bundleId;
            BulkJPAExecutor bulkjpa = new BulkJPAExecutor(BundleEngine.parseBulkFilter(request), 1, 1);
            try {
                BulkResponseInfo response = jpaService.execute(bulkjpa);
                assertEquals(response.getResponses().get(0).getBundle().getId(), bundleId);
            }
            catch (JPAExecutorException jex) {
                fail(); // should not throw exception as this case is now supported
            }
        }
View Full Code Here

     */
    @Override
    protected BulkResponseInfo execute() throws CommandException {
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            BulkResponseInfo bulk = null;
            if (jpaService != null) {
                bulk = jpaService.execute(new BulkJPAExecutor(bulkParams, start, len));
            }
            else {
                LOG.error(ErrorCode.E0610);
View Full Code Here

            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));
            BulkResponseInfo bulkResponse = bundleEngine.getBulkJobs(bulkFilter, start, len);
            List<BulkResponseImpl> responsesToJson = bulkResponse.getResponses();

            json.put(JsonTags.BULK_RESPONSES, BulkResponseImpl.toJSONArray(responsesToJson, timeZoneId));
            json.put(JsonTags.BULK_RESPONSE_TOTAL, bulkResponse.getTotal());
            json.put(JsonTags.BULK_RESPONSE_OFFSET, bulkResponse.getStart());
            json.put(JsonTags.BULK_RESPONSE_LEN, bulkResponse.getLen());

        }
        catch (BaseEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
        }
View Full Code Here

     */
    @Override
    protected BulkResponseInfo execute() throws CommandException {
        try {
            JPAService jpaService = Services.get().get(JPAService.class);
            BulkResponseInfo bulk = null;
            if (jpaService != null) {
                bulk = jpaService.execute(new BulkJPAExecutor(bulkParams, start, len));
            }
            else {
                LOG.error(ErrorCode.E0610);
View Full Code Here

            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));
            BulkResponseInfo bulkResponse = bundleEngine.getBulkJobs(bulkFilter, start, len);
            List<BulkResponseImpl> responsesToJson = bulkResponse.getResponses();

            json.put(JsonTags.BULK_RESPONSES, BulkResponseImpl.toJSONArray(responsesToJson, timeZoneId));
            json.put(JsonTags.BULK_RESPONSE_TOTAL, bulkResponse.getTotal());
            json.put(JsonTags.BULK_RESPONSE_OFFSET, bulkResponse.getStart());
            json.put(JsonTags.BULK_RESPONSE_LEN, bulkResponse.getLen());

        }
        catch (BaseEngineException ex) {
            throw new XServletException(HttpServletResponse.SC_BAD_REQUEST, ex);
        }
View Full Code Here

            String conditions = actionQuery(em, bundleBean, actionTimes, responseList);

            // Query to get the count of records
            long total = countQuery(conditions, em, bundleBean, actionTimes);

            BulkResponseInfo bulk = new BulkResponseInfo(responseList, start, len, total);
            return bulk;
        }
        catch (Exception e) {
            throw new JPAExecutorException(ErrorCode.E0603, e.getMessage(), e);
        }
View Full Code Here

            String conditions = actionQuery(em, bundleBean, actionTimes, responseList);

            // Query to get the count of records
            long total = countQuery(conditions, em, bundleBean, actionTimes);

            BulkResponseInfo bulk = new BulkResponseInfo(responseList, start, len, total);
            return bulk;
        }
        catch (Exception e) {
            throw new JPAExecutorException(ErrorCode.E0603, e);
        }
View Full Code Here

TOP

Related Classes of org.apache.oozie.BulkResponseInfo

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.