use of org.icgc.dcc.song.client.register.Registry in project SONG by overture-stack.
the class Benchmark method waitForStatus.
public void waitForStatus(PayloadFileVisitor payloadFileVisitor) {
for (val studyId : payloadFileVisitor.getStudies()) {
val registry = new Registry(createConfig(studyId), new RestClient());
val uploadDatas = payloadFileVisitor.getDataForStudy(studyId);
waitForStatusForStudy(studyId, registry, uploadDatas);
}
}
use of org.icgc.dcc.song.client.register.Registry in project SONG by overture-stack.
the class Benchmark method upload.
public void upload(PayloadFileVisitor payloadFileVisitor) {
for (val studyId : payloadFileVisitor.getStudies()) {
setupStudy(studyId);
val registry = new Registry(createConfig(studyId), new RestClient());
checkState(registry.isAlive(), "The song server '%s' is not running", benchmarkConfig.getAccessToken());
val uploadDatas = payloadFileVisitor.getDataForStudy(studyId);
uploadStudy(studyId, registry, uploadDatas);
}
}
use of org.icgc.dcc.song.client.register.Registry in project SONG by overture-stack.
the class Benchmark method save.
public void save(PayloadFileVisitor payloadFileVisitor) {
for (val studyId : payloadFileVisitor.getStudies()) {
val registry = new Registry(createConfig(studyId), new RestClient());
val uploadDatas = payloadFileVisitor.getDataForStudy(studyId);
saveForStudy(studyId, registry, uploadDatas);
}
}
use of org.icgc.dcc.song.client.register.Registry 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