Package org.apache.oozie.client

Examples of org.apache.oozie.client.CoordinatorAction


                this.appName = "testCoordinatorJobApp";
                this.appPath = "testCoordinatorJobAppPath";
            }
        };

        CoordinatorAction coordinatorAction = createCoordinatorAction(dtObject);
        assertPrintCoordActionOutput(readCoordAction(coordinatorAction), dtObject);
    }
View Full Code Here


        when(workflowJobMock.getActions()).thenReturn(Arrays.asList(ac, ac0));
        return workflowJobMock;
    }

    private static CoordinatorAction createCoordinatorAction(DataObject dtObject) {
        CoordinatorAction crdActionMock = mock(CoordinatorAction.class);
        when(crdActionMock.getId()).thenReturn(dtObject.deamonName);
        when(crdActionMock.getJobId()).thenReturn(dtObject.appName);
        when(crdActionMock.getActionNumber()).thenReturn(11);
        when(crdActionMock.getStatus()).thenReturn(CoordinatorAction.Status.SUBMITTED);
        return crdActionMock;
    }
View Full Code Here

        BulkResponse bulkResponse = mock(BulkResponse.class);

        BundleJob bundleJob = createBundleJob(dtObject);
        when(bulkResponse.getBundle()).thenReturn(bundleJob);

        CoordinatorAction coordinatorAction = createCoordinatorAction(dtObject);
        when(bulkResponse.getAction()).thenReturn(coordinatorAction);

        CoordinatorJob coordinatorJob = createCoordinatorJob(dtObject);
        when(bulkResponse.getCoordinator()).thenReturn(coordinatorJob);
        return bulkResponse;
View Full Code Here

    public void testParseBulkResponse() {
        JSONObject json = createJsonBulkResponse();

        BundleJob bulkBundle = JsonToBean.createBundleJob((JSONObject) json.get(JsonTags.BULK_RESPONSE_BUNDLE));
        CoordinatorJob bulkCoord = JsonToBean.createCoordinatorJob((JSONObject) json.get(JsonTags.BULK_RESPONSE_COORDINATOR));
        CoordinatorAction bulkAction = JsonToBean.createCoordinatorAction((JSONObject) json.get(JsonTags.BULK_RESPONSE_ACTION));

        assertNotNull(bulkBundle);
        assertNotNull(bulkCoord);
        assertNotNull(bulkAction);
        assertEquals("bundle-app", bulkBundle.getAppName());
        assertEquals("bundle-id", bulkBundle.getId());
        assertEquals(BundleJob.Status.RUNNING, bulkBundle.getStatus());
        assertEquals("coord-app", bulkCoord.getAppName());
        assertEquals(CoordinatorJob.Status.SUSPENDED, bulkCoord.getStatus());
        assertEquals("action-id", bulkAction.getId());
        assertEquals("coord-id", bulkAction.getJobId());
        assertEquals(1, bulkAction.getActionNumber());
        assertEquals("action-externalId", bulkAction.getExternalId());
        assertEquals(CoordinatorAction.Status.FAILED, bulkAction.getStatus());
        assertEquals("action-externalStatus", bulkAction.getExternalStatus());
        assertEquals("action-errorCode", bulkAction.getErrorCode());
        assertEquals("action-errorMessage", bulkAction.getErrorMessage());
        assertEquals(JsonUtils.parseDateRfc822(CREATED_TIME), bulkAction.getCreatedTime());
        assertEquals(JsonUtils.parseDateRfc822(NOMINAL_TIME), bulkAction.getNominalTime());
        assertEquals("action-missingDeps", bulkAction.getMissingDependencies());
    }
View Full Code Here

        store2.closeTrx();

        waitFor(120 * 1000, new Predicate() {
            @Override
            public boolean evaluate() throws Exception {
                CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
                return (bean.getStatus() == CoordinatorAction.Status.READY || bean.getStatus() == CoordinatorAction.Status.SUBMITTED);
            }
        });

        CoordinatorStore store3 = Services.get().get(StoreService.class).getStore(CoordinatorStore.class);
        store3.beginTrx();
View Full Code Here

        store2.closeTrx();

        waitFor(120 * 1000, new Predicate() {
            @Override
            public boolean evaluate() throws Exception {
                CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
                return (bean.getStatus() == CoordinatorAction.Status.WAITING || bean.getStatus() == CoordinatorAction.Status.READY);
            }
        });

        // after cleanup
        assertFalse(fs.exists(success));
View Full Code Here

        store2.commitTrx();
        store2.closeTrx();
        waitFor(120 * 1000, new Predicate() {
            @Override
            public boolean evaluate() throws Exception {
                CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
                return (bean.getStatus() == CoordinatorAction.Status.WAITING || bean.getStatus() == CoordinatorAction.Status.READY);
            }
        });
        CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
        assertTrue(bean.getStatus() == CoordinatorAction.Status.WAITING
                || bean.getStatus() == CoordinatorAction.Status.READY);
    }
View Full Code Here

        assertFalse(jmsService.isListeningToTopic(hcatService.getJMSConnectionInfo(new URI(newHCatDependency1)), db
                + "." + table));

        populateTable(db, table);
        String actionId = addInitRecords(newHCatDependency);
        CoordinatorAction ca = checkCoordActionDependencies(actionId, newHCatDependency);
        assertEquals(CoordinatorAction.Status.WAITING, ca.getStatus());
        // Register the missing dependencies to PDMS assuming CoordPushDependencyCheckCommand did this.
        pdms.addMissingDependency(new HCatURI(newHCatDependency1), actionId);
        pdms.addMissingDependency(new HCatURI(newHCatDependency2), actionId);

        sleep(2000);
View Full Code Here

        store2.commitTrx();
        store2.closeTrx();

        waitFor(120 * 1000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
                return (bean.getStatus() == CoordinatorAction.Status.READY || bean.getStatus() == CoordinatorAction.Status.SUBMITTED);
            }
        });

        CoordinatorStore store3 = Services.get().get(StoreService.class).getStore(CoordinatorStore.class);
        store3.beginTrx();
View Full Code Here

        store2.commitTrx();
        store2.closeTrx();

        waitFor(120 * 1000, new Predicate() {
            public boolean evaluate() throws Exception {
                CoordinatorAction bean = coordClient.getCoordActionInfo(actionId);
                return (bean.getStatus() == CoordinatorAction.Status.WAITING || bean.getStatus() == CoordinatorAction.Status.READY);
            }
        });

        // after cleanup
        assertFalse(fs.exists(success));
View Full Code Here

TOP

Related Classes of org.apache.oozie.client.CoordinatorAction

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.