Ejemplo n.º 1
0
    def __init__(self, session, config, parent):

        # don't inherit metadataPath!
        C3Object.__init__(self, session, config, parent)
        self.switching = self.get_setting(session, 'bucketType', '') or \
                         self.get_setting(session, 'maxBuckets', 0) or \
                         self.get_setting(session, 'maxItemsPerBucket', 0)

        SummaryObject.__init__(self, session, config, parent)
        self.idNormalizer = self.get_path(session, 'idNormalizer', None)
        self.outIdNormalizer = self.get_path(session, 'outIdNormalizer', None)
        self.inWorkflow = self.get_path(session, 'inWorkflow', None)
        self.outWorkflow = self.get_path(session, 'outWorkflow', None)

        self.session = session

        dbts = self.get_storageTypes(session)
        self.storageTypes = dbts
        revdbts = self.get_reverseMetadataTypes(session)
        self.reverseMetadataTypes = revdbts

        self.useUUID = self.get_setting(session, 'useUUID', 0)
        self.expires = self.get_default(session, 'expires', 0)


        for dbt in dbts:
            self._initDb(session, dbt)
            self._verifyDb(session, dbt)
            if dbt in revdbts:
                dbt = dbt + "Reverse"
                self._initDb(session, dbt)
                self._verifyDb(session, dbt)
Ejemplo n.º 2
0
    def __init__(self, session, config, parent):
        # Don't inherit metadataPath!
        C3Object.__init__(self, session, config, parent)
        self.switching = (
            self.get_setting(session, 'bucketType', '') or \
            self.get_setting(session, 'maxBuckets', 0) or \
            self.get_setting(session, 'maxItemsPerBucket', 0))

        SummaryObject.__init__(self, session, config, parent)
        self.idNormalizer = self.get_path(session, 'idNormalizer', None)
        self.outIdNormalizer = self.get_path(session, 'outIdNormalizer', None)
        self.inWorkflow = self.get_path(session, 'inWorkflow', None)
        self.outWorkflow = self.get_path(session, 'outWorkflow', None)

        self.session = session

        dbts = self.get_storageTypes(session)
        self.storageTypes = dbts
        revdbts = self.get_reverseMetadataTypes(session)
        self.reverseMetadataTypes = revdbts

        self.useUUID = self.get_setting(session, 'useUUID', 0)
        self.expires = self.get_default(session, 'expires', 0)

        for dbt in dbts:
            self._initDb(session, dbt)
            self._verifyDb(session, dbt)
            if dbt in revdbts:
                dbt = dbt + "Reverse"
                self._initDb(session, dbt)
                self._verifyDb(session, dbt)
Ejemplo n.º 3
0
    def __init__(self, session, config, parent):
        C3Object.__init__(self, session, config, parent)
        if irods is None:
            raise MissingDependencyException(self.objectType, 'irods (PyRods)')
        self.cxn = None
        self.coll = None
        self.env = None
        self.idNormalizer = self.get_path(session, 'idNormalizer', None)
        self.outIdNormalizer = self.get_path(session,
                                             'outIdNormalizer',
                                             None)
        self.inWorkflow = self.get_path(session, 'inWorkflow', None)
        self.outWorkflow = self.get_path(session, 'outWorkflow', None)
        self.session = session

        self.useUUID = self.get_setting(session, 'useUUID', 0)
        self.expires = self.get_default(session, 'expires', 0)

        self.host = self.get_setting(session, 'irodsHost', '')
        self.port = self.get_setting(session, 'irodsPort', 0)
        self.user = self.get_setting(session, 'irodsUser', '')
        self.zone = self.get_setting(session, 'irodsZone', '')
        self.passwd = self.get_setting(session, 'irodsPassword', '')
        self.resource = self.get_setting(session, 'irodsResource', '')

        self.allowStoreSubDirs = self.get_setting(session,
                                                  'allowStoreSubDirs',
                                                  1)
        self._open(session)
Ejemplo n.º 4
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     TaskManager(session)
     nTasks = self.get_setting(session, 'nTasks')
     if nTasks:
         # Size of MPI world should be the ceiling
         self.nTasks = min(nTasks, self.nTasks)
     self.hostname = self.get_setting(session, 'hostname', self.hostname)
Ejemplo n.º 5
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     TaskManager(session)
     nTasks = self.get_setting(session, 'nTasks')
     if nTasks:
         # Size of MPI world should be the ceiling
         self.nTasks = min(nTasks, self.nTasks)
     self.hostname = self.get_setting(session, 'hostname', self.hostname)
Ejemplo n.º 6
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     self.cxn = None
     self.host = self.get_setting(session, 'host', 'localhost')
     self.port = self.get_setting(session, 'port', 9160)
     self.keyspace = self.get_setting(session, 'keyspace', '{0}_{1}'.format(parent.id, self.id))
     self.username = self.get_setting(session, 'user', None)
     self.passwd = self.get_setting(session, 'password', None)
     self.servers = ['{0}:{1}'.format(self.host, self.port)] 
     self._verifyDatabase(session)
Ejemplo n.º 7
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     self.cxn = None
     self.host = self.get_setting(session, 'host', 'localhost')
     self.port = self.get_setting(session, 'port', 9160)
     self.keyspace = self.get_setting(session, 'keyspace', '{0}_{1}'.format(parent.id, self.id))
     self.username = self.get_setting(session, 'user', None)
     self.passwd = self.get_setting(session, 'password', None)
     self.servers = ['{0}:{1}'.format(self.host, self.port)] 
     self._verifyDatabase(session)
Ejemplo n.º 8
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     self.session = session
     self.debug = 0
     self.nTasks = self.get_setting(session, 'nTasks')
     if not self.nTasks:
         self.nTasks = mp.cpu_count()
     self.tasks = {}
     self.claimed_tasks = {}
     self.idle_tasks = []
     for t in range(1, self.nTasks + 1):
         wt = Task(session, name=t, manager=self, debug=self.debug)
         self.tasks[t] = wt
         self.idle_tasks.append(wt)
Ejemplo n.º 9
0
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     self.session = session
     self.debug = 0
     self.nTasks = self.get_setting(session, 'nTasks')
     if not self.nTasks:
         self.nTasks = mp.cpu_count()
     self.tasks = {}
     self.claimed_tasks = {}
     self.idle_tasks = []
     for t in range(1, self.nTasks + 1):
         wt = Task(session, name=t, manager=self, debug=self.debug)
         self.tasks[t] = wt
         self.idle_tasks.append(wt)
Ejemplo n.º 10
0
    def __init__(self, session, configFile="serverConfig.xml"):
        # self.defaultFunctionLog = "__api__"
        self.defaultFunctionLog = ""
        self.databaseConfigs = {}
        self.databases = {}
        self.id = "DefaultServer"
        session.server = self

        # Bootstrappage
        dom = self._getDomFromFile(session, configFile)
        try:
            topNode = dom.childNodes[0]
        except:
            topNode = dom
        C3Object.__init__(self, session, topNode, None)

        # Add default logger to session
        log = self.get_path(session, 'defaultLogger', None)
        if log:
            session.logger = log
 def __init__(self, session, config, parent):
     C3Object.__init__(self, session, config, parent)
     raise MissingDependencyException(self.objectType, 'irods (PyRods)')