1. A method comprising: determining a job schedule of multiple MapReduce jobs across multiple MapReduce flows in a cluster environment, wherein each of said MapReduce flows comprises two or more of the multiple MapReduce jobs and wherein said job schedule does not violate a precedence constraint of the corresponding MapReduce flow and reduces makespan of the corresponding MapReduce flow, wherein determining the job schedule comprises assigning each MapReduce job a maximum number of identical slots corresponding to that MapReduce job and scheduling the MapReduce jobs in increasing order of start time from smallest to largest; determining a flow schedule for the multiple MapReduce flows to optimize a given metric across all of the multiple MapReduce jobs, wherein said flow schedule comprises a number of identical slots allotted to each of the multiple MapReduce flows, and wherein said number of identical slots is two or more; transforming each job schedule into the flow schedule; and allocating, by using the flow schedule, resources for the multiple MapReduce flows in the cluster environment without violating a precedence constraint of any of the multiple MapReduce flows; wherein at least one of the steps is carried out by a computer device.