response.put("msg", "missing project metadata for graph '" + graphId + "'");
tx.rollback();
return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
}
JobMetadata jobMetadata = tx.createJob(projectMetadata);
response.put("status", "ok");
response.put("msg", "job submitted");
response.put("jobId", jobMetadata.getId().toString());
tx.commit();
if (!algorithm.equals("approximate_diameter") &&
!algorithm.equals("connected_component") &&
!algorithm.equals("connected_component_stats") &&
!algorithm.equals("directed_triangle_count") &&
!algorithm.equals("eigen_vector_normalization") &&
!algorithm.equals("graph_laplacian") &&
!algorithm.equals("kcore") &&
!algorithm.equals("pagerank") &&
!algorithm.equals("partitioning") &&
!algorithm.equals("simple_coloring") &&
!algorithm.equals("simple_undirected_triangle_count") &&
!algorithm.equals("sssp") &&
!algorithm.equals("TSC") &&
!algorithm.equals("undirected_triangle_count")) {
response.put("status", "error");
response.put("msg", algorithm + " not implemented");
return new ResponseEntity<>(response, HttpStatus.NOT_FOUND);
}
// We can't pass the values directly because they'll live in a separate thread.
graphLabService.graphLabAlgorithm(graph, algorithm, jobMetadata.getId());
return new ResponseEntity<>(response, HttpStatus.OK);
}