public final StudyConfiguration getStudyConfiguration() throws StorageEngineException { return getStudyConfiguration(false); }
protected StudyConfiguration checkExistsStudyConfiguration(StudyConfiguration studyConfiguration) throws StorageEngineException { if (studyConfiguration == null) { studyConfiguration = getStudyConfiguration(); if (studyConfiguration == null) { String studyName = options.getString(Options.STUDY.key(), Options.STUDY.defaultValue()); logger.info("Creating a new StudyConfiguration '{}'", studyName); studyConfiguration = getStudyConfigurationManager().createStudy(studyName); } } privateStudyConfiguration = studyConfiguration; setStudyId(studyConfiguration.getStudyId()); return studyConfiguration; }
protected int getStudyId() throws StorageEngineException { if (privateStudyId == null) { privateStudyId = getStudyConfiguration().getStudyId(); return privateStudyId; } else { return privateStudyId; } }
protected StudyConfiguration getOrCreateStudyConfiguration(boolean forceFetch) throws StorageEngineException { return checkExistsStudyConfiguration(getStudyConfiguration(forceFetch)); }
protected final URI postLoad(URI input, URI output, List<Integer> fileIds) throws StorageEngineException { if (fileIds == null || fileIds.isEmpty()) { fileIds = Collections.singletonList(getFileId()); } int studyId = getStudyId(); long lock = dbAdaptor.getStudyConfigurationManager().lockStudy(studyId); // Check loaded variants BEFORE updating the StudyConfiguration checkLoadedVariants(fileIds, getStudyConfiguration()); StudyConfiguration studyConfiguration; try { //Update StudyConfiguration studyConfiguration = getStudyConfiguration(true); securePostLoad(fileIds, studyConfiguration); dbAdaptor.getStudyConfigurationManager().updateStudyConfiguration(studyConfiguration, new QueryOptions()); } finally { dbAdaptor.getStudyConfigurationManager().unLockStudy(studyId, lock); } return input; }
String fileName = Paths.get(filePath).getFileName().toString(); StudyConfiguration studyConfiguration = storageETL.getStudyConfiguration();