def loadJobStore( jobStoreString, config=None ): """ Loads a jobStore. :param jobStoreString: see exception message below :param config: see AbstractJobStore.__init__ :return: an instance of a concrete subclass of AbstractJobStore :rtype: jobStores.abstractJobStore.AbstractJobStore """ if jobStoreString[ 0 ] in '/.': jobStoreString = 'file:' + jobStoreString try: jobStoreName, jobStoreArgs = jobStoreString.split( ':', 1 ) except ValueError: raise RuntimeError( 'Job store string must either be a path starting in . or / or a contain at least one ' 'colon separating the name of the job store implementation from an initialization ' 'string specific to that job store. If a path starting in . or / is passed, the file ' 'job store will be used for backwards compatibility.' ) if jobStoreName == 'file': from toil.jobStores.fileJobStore import FileJobStore return FileJobStore( jobStoreArgs, config=config ) elif jobStoreName == 'aws': from toil.jobStores.aws.jobStore import AWSJobStore return AWSJobStore.createJobStore( jobStoreArgs, config=config ) elif jobStoreName == 'azure': from toil.jobStores.azureJobStore import AzureJobStore account, namePrefix = jobStoreArgs.split( ':', 1 ) return AzureJobStore( account, namePrefix, config=config ) else: raise RuntimeError( "Unknown job store implementation '%s'" % jobStoreName )
def _createJobStore(self, config=None): from toil.jobStores.aws.jobStore import AWSJobStore partSize = self._partSize() for encrypted in (True, False): self.assertTrue(AWSJobStore.FileInfo.maxInlinedSize(encrypted) < partSize) AWSJobStore.FileInfo.s3PartSize = partSize return AWSJobStore.createJobStore(self.testRegion + ':' + self.namePrefix, config=config)
def loadJobStore(jobStoreString, config=None): """ Loads a jobStore. :param jobStoreString: see exception message below :param config: see AbstractJobStore.__init__ :return: an instance of a concrete subclass of AbstractJobStore :rtype: jobStores.abstractJobStore.AbstractJobStore """ if jobStoreString[0] in '/.': jobStoreString = 'file:' + jobStoreString try: jobStoreName, jobStoreArgs = jobStoreString.split(':', 1) except ValueError: raise RuntimeError( 'Job store string must either be a path starting in . or / or a contain at least one ' 'colon separating the name of the job store implementation from an initialization ' 'string specific to that job store. If a path starting in . or / is passed, the file ' 'job store will be used for backwards compatibility.') if jobStoreName == 'file': from toil.jobStores.fileJobStore import FileJobStore return FileJobStore(jobStoreArgs, config=config) elif jobStoreName == 'aws': from toil.jobStores.aws.jobStore import AWSJobStore return AWSJobStore.createJobStore(jobStoreArgs, config=config) elif jobStoreName == 'azure': from toil.jobStores.azureJobStore import AzureJobStore account, namePrefix = jobStoreArgs.split(':', 1) return AzureJobStore(account, namePrefix, config=config) else: raise RuntimeError("Unknown job store implementation '%s'" % jobStoreName)
def _createJobStore(self, config=None): from toil.jobStores.aws.jobStore import AWSJobStore partSize = self._partSize() for encrypted in (True, False): self.assertTrue( AWSJobStore.FileInfo.maxInlinedSize(encrypted) < partSize) AWSJobStore.FileInfo.s3PartSize = partSize return AWSJobStore.createJobStore(self.testRegion + ':' + self.namePrefix, config=config)