Package org.apache.oozie

Examples of org.apache.oozie.WorkflowsInfo


            wfBeansList.add(ww);
        }

        realLen = ((Long) qTotal.getSingleResult()).intValue();

        return new WorkflowsInfo(wfBeansList, start, len, realLen);
    }
View Full Code Here


        this.len = length;
    }

    @Override
    protected WorkflowsInfo call(WorkflowStore store) throws StoreException {
        WorkflowsInfo workflowsInfo = store.getWorkflowsInfo(filter, start, len);
        for (WorkflowJobBean workflow : workflowsInfo.getWorkflows()) {
            workflow.setConsoleUrl(JobCommand.getJobConsoleUrl(workflow.getId()));
        }
        return workflowsInfo;
    }
View Full Code Here

    }

    private void _testGetWFInfos() throws StoreException {
        Map<String, List<String>> filter = new HashMap<String, List<String>>();
        store.beginTrx();
        WorkflowsInfo wfInfo = store.getWorkflowsInfo(filter, 1, 1);
        System.out.println("got WorkflowsInfo " + wfInfo.getLen());
        List<WorkflowJobBean> wfBeans = wfInfo.getWorkflows();
        store.commitTrx();

        assertEquals(1, wfBeans.size());

        filter = new HashMap<String, List<String>>();
        wfInfo = store.getWorkflowsInfo(filter, 1, 2);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(2, wfBeans.size());

        filter = new HashMap<String, List<String>>();
        filter.put("user", Arrays.asList("testUser1"));
        wfInfo = store.getWorkflowsInfo(filter, 1, 2);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(1, wfBeans.size());

        filter = new HashMap<String, List<String>>();
        filter.put("user", Arrays.asList("testUser1", "testUser2"));
        wfInfo = store.getWorkflowsInfo(filter, 1, 2);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(2, wfBeans.size());

        filter = new HashMap<String, List<String>>();
        filter.put("user", Arrays.asList("testUser1"));
        filter.put("status", Arrays.asList("succeeded"));

        wfInfo = store.getWorkflowsInfo(filter, 1, 2);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(1, wfBeans.size());

        filter = new HashMap<String, List<String>>();
        filter.put("user", Arrays.asList("testUser1", "testUser2"));
        filter.put("name", Arrays.asList("testApp"));
        wfInfo = store.getWorkflowsInfo(filter, 1, 2);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(2, wfBeans.size());
        assertEquals(2, wfInfo.getTotal());
        assertEquals(1, wfInfo.getStart());
        assertEquals(2, wfInfo.getLen());

        filter = new HashMap<String, List<String>>();
        filter.put("user", Arrays.asList("testUser1", "testUser2"));
        filter.put("name", Arrays.asList("testApp"));
        wfInfo = store.getWorkflowsInfo(filter, 1, 1);
        wfBeans = wfInfo.getWorkflows();
        assertEquals(1, wfBeans.size());
        assertEquals(2, wfInfo.getTotal());
        assertEquals(1, wfInfo.getStart());
        assertEquals(1, wfInfo.getLen());
    }
View Full Code Here

        @Override
        public WorkflowsInfo getJobs(String filter, int start, int len) throws DagEngineException {
            parseFilter(filter);
            did = RestConstants.JOBS_FILTER_PARAM;
            return new WorkflowsInfo((List) workflows, start, len, workflows.size());
        }
View Full Code Here

TOP

Related Classes of org.apache.oozie.WorkflowsInfo

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.