0% found this document useful (0 votes)
9 views5 pages

Java and Oozie Workflow Examples

Uploaded by

teja.de2022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views5 pages

Java and Oozie Workflow Examples

Uploaded by

teja.de2022
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

hello

Hello
/type hello
Map<Integer,Integer> inputMap = new Map<Integer,Integer>();
Integer cnt =0;

for(i=0;i<=[Link];i++){
[Link](i,array(i));
}

outputMap = []
For s,x in enumerate(array):
If [Link](outputMap.):
Cnt ++;
print(x)
Else
outputMap

{
A:1,
B:1}

Attribute
A1 = team1

sideinput(team1, pubsub1)
//write any java code you are proud of
Pcollection<messages> pcollection = [Link](“”);
Pcollecton<Map<String,String>> sideInput = [Link]([Link])

[Link](Pubsub,Pubsub) {
[Link](A1)

//write any airflow dag you’ve written in the past


With dag(schedule = @daily,name =””, )

## python function
Def createStoragBucket(blobname):
[Link]():
getName
Else:
createStorageAccoutn)

##Bash operator
Def sshConnection(key,hadoop ser ingpt)
#Spark Submit
SparkSub

//oozie
<workflow-app name="complex-workflow" xmlns="uri:oozie:workflow:0.5">

<!-- Start node: Entry point of the workflow -->

<start to="shell-action"/>

<!-- Action node: Executes a shell script with an argument -->

<action name="shell-action">

<shell>

<exec>[Link]</exec>

<argument>arg1</argument>

</shell>

<ok to="decision-node"/> <!-- If shell script succeeds, go to decision


node -->

<error to="fail"/> <!-- If shell script fails, go to fail node -->

</action>

<!-- Decision node: Chooses the next path based on a variable -->

<decision name="decision-node">

<switch>

<!-- If the condition is true, go to sub-workflow -->

<case to="subwf-action">${wf:conf('decisionVar') == 'true'}</case>

<!-- Otherwise, go to Java action -->

<default to="java-action"/>
</switch>

</decision>

<!-- Sub-workflow action: Triggers another Oozie workflow -->

<action name="subwf-action">

<sub-workflow>

<app-path>${nameNode}/user/oozie/sub-workflow</app-path>

</sub-workflow>

<ok to="end"/> <!-- If sub-workflow succeeds, go to end node -->

<error to="fail"/> <!-- If sub-workflow fails, go to fail node -->

</action>

<!-- Java action: Executes a Java class with an argument -->

<action name="java-action">

<java>

<main-class>[Link]</main-class>

<arg>arg1</arg>

</java>

<ok to="end"/> <!-- If Java action succeeds, go to end node -->

<error to="fail"/> <!-- If Java action fails, go to fail node -->

</action>

<!-- Kill node: Ends the workflow if any action fails -->

<kill name="fail">
<message>Workflow failed</message>

</kill>

<!-- End node: Marks the successful completion of the workflow -->

<end name="end"/>

</workflow-app>

You might also like