use of org.icgc.dcc.song.client.benchmark.model.UploadData in project SONG by overture-stack.
the class Benchmark method saveForStudy.
@SneakyThrows
private void saveForStudy(String studyId, Registry registry, List<UploadData> uploadDataList) {
val modList = uploadDataList.stream().filter(x -> !x.getUploadState().equals("VALIDATION_ERROR")).collect(toList());
val total = modList.size();
val errored = uploadDataList.size() - total;
log.warn("Num Errored Files: {}", errored);
int count = 0;
val saveMonitor = monitor.getStudyMonitor(studyId).getSaveMonitor();
for (val uploadData : modList) {
val submittedAnalysisId = uploadData.getAnalysisId();
val idExists = doesIdExist(uploadData.getStudyId(), registry, submittedAnalysisId);
log.info("ANALYSIS_ID {} existence: {}", submittedAnalysisId, idExists);
val rawResponse = saveMonitor.callIncr(() -> registry.save(uploadData.getStudyId(), uploadData.getUploadId(), benchmarkConfig.isIgnoreIdCollisions()));
val response = readTree(rawResponse.getOutputs());
val status = response.path("status").textValue();
val analysisId = response.path("analysisId").textValue();
uploadData.setAnalysisId(analysisId);
log.info("Saving {} file {} /{} : {}", uploadData.getStudyId(), ++count, total, uploadData.getFile().getFileName().toString());
}
}
Aggregations