class DagBuilder {

  public static Dag getPurgingDag(JsonCluster cluster, ClusterRuntime clusterEntity, ClusterStats clusterStats,
      TaskSubmitter submitter, Map<String, JsonObject> chefJsons) throws KaramelException {
    Dag dag = new Dag();
    Map<String, RunRecipeTask> allRecipeTasks = new HashMap<>();
    CookbookCache cache = ClusterDefinitionService.CACHE;
    List<KaramelizedCookbook> kcbs = cache.loadRootKaramelizedCookbooks(cluster);
    machineLevelTasks(cluster, clusterEntity, clusterStats, submitter, dag, kcbs);
    cookbookLevelPurgingTasks(cluster, clusterEntity, clusterStats, chefJsons, submitter, allRecipeTasks, dag, kcbs);
    return dag;
  }

}