use of org.icgc.dcc.song.importer.model.PortalFileMetadata in project SONG by overture-stack.
the class Importer method processSpecimensAndSamples.
private void processSpecimensAndSamples(List<PortalFileMetadata> portalFileMetadataList) {
log.info("Converting Specimen and Samples...");
val specimenSampleTuples = SPECIMEN_SAMPLE_CONVERTER.convertSpecimenSampleTuples(portalFileMetadataList);
// Aggregating specimens
val specimens = specimenSampleTuples.stream().collect(groupingBy(SpecimenSampleTuple::getSpecimen)).keySet();
log.info("Updating SpecimenRepository with {} specimens", specimens.size());
specimens.forEach(repositoryDao::createSpecimen);
// Aggregating samples
val samples = specimenSampleTuples.stream().collect(groupingBy(x -> x.getSample().getSampleId())).entrySet().stream().map(// TODO: why??
x -> x.getValue().get(0).getSample()).collect(toImmutableSet());
log.info("Updating SampleRepository with {} samples", samples.size());
samples.forEach(repositoryDao::createSample);
}
use of org.icgc.dcc.song.importer.model.PortalFileMetadata in project SONG by overture-stack.
the class DccMetadataFetcher method processDccMetadata.
private Set<File> processDccMetadata(DccMetadata dccMetadata, Map<String, List<PortalFileMetadata>> objectIdMap) {
val objectId = dccMetadata.getId();
val portalFileMetadatasForObjectId = objectIdMap.get(objectId);
val file = simpleDccStorageClient.getFile(objectId, "N/A", dccMetadata.getFileName());
return portalFileMetadatasForObjectId.stream().map(x -> buildFile(dccMetadata, file, x)).collect(toImmutableSet());
}
use of org.icgc.dcc.song.importer.model.PortalFileMetadata in project SONG by overture-stack.
the class DccMetadataFetcher method fetchDccMetadataFiles.
public Set<File> fetchDccMetadataFiles(List<PortalFileMetadata> portalFileMetadatas) {
val objectIdMap = groupDccMetadataIds(portalFileMetadatas);
val dccMetadatas = dccMetadataDao.findByMultiObjectIds(objectIdMap.keySet());
val counterMonitor = newMonitor("dccMetadataFiles", 1000);
counterMonitor.start();
val set = dccMetadatas.stream().map(x -> processDccMetadata(x, objectIdMap)).map(counterMonitor::streamCollectionCount).flatMap(Collection::stream).collect(toImmutableSet());
counterMonitor.stop();
counterMonitor.displaySummary();
return set;
}
Aggregations