Example #1
0
 def __init__(self, **options):
     dict.__init__(self)
     WMObject.__init__(self)
     self.setdefault("name", None)
     self.setdefault("type", CollectionTypes.GenericCollection)
     self.setdefault("filesets", [])
     self.update(options)
Example #2
0
    def __init__(self, config, couchDbName = None, couchurl = None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")
        self.designDoc = "HarvestingDatasets"

        if couchDbName == None:
            self.dbname = getattr(self.config.HarvestingScheduler, "couchDBName",
                                  "dqm_default")
        else:
            self.dbname = couchDbName

        if couchurl is not None:
            self.couchurl = couchurl
        elif getattr(self.config.HarvestingScheduler, "couchurl",
                                                            None) is not None:
            self.couchurl = self.config.HarvestingScheduler.couchurl
        else:
            self.couchurl = self.config.JobStateMachine.couchurl

        try:
            self.couchdb = CouchServer(self.couchurl)
            if self.dbname not in self.couchdb.listDatabases():
                self.createDatabase()

            self.database = self.couchdb.connectDatabase(self.dbname,
                                                         size=_LIMIT)
        except Exception, ex:
            logging.error("Error connecting to couch: %s" % str(ex))
            self.database = None
Example #3
0
    def __init__(self, config, couchDbName = None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName == None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName
            
        self.jobsdatabase = None
        self.fwjrdatabase = None
        self.jsumdatabase = None
        self.statsumdatabase = None
        
        self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
        self._connectDatabases()

        try:
            self.dashboardReporter = DashboardReporter(config)
        except Exception as ex:
            logging.error("Error setting up the \
-                          dashboard reporter: %s" % str(ex))
            raise

        self.getCouchDAO = self.daofactory("Jobs.GetCouchID")
        self.setCouchDAO = self.daofactory("Jobs.SetCouchID")
        self.incrementRetryDAO = self.daofactory("Jobs.IncrementRetry")
        self.workflowTaskDAO = self.daofactory("Jobs.GetWorkflowTask")
        self.jobTypeDAO = self.daofactory("Jobs.GetType")
        self.updateLocationDAO = self.daofactory("Jobs.UpdateLocation")

        self.maxUploadedInputFiles = getattr(self.config.JobStateMachine, 'maxFWJRInputFiles', 1000)
        return
Example #4
0
    def __init__(self, config, couchDbName=None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName == None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName

        try:
            self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
            self.jobsdatabase = self.couchdb.connectDatabase("%s/jobs" %
                                                             self.dbname,
                                                             size=250)
            self.fwjrdatabase = self.couchdb.connectDatabase("%s/fwjrs" %
                                                             self.dbname,
                                                             size=250)
            self.jsumdatabase = self.couchdb.connectDatabase(getattr(
                self.config.JobStateMachine, 'jobSummaryDBName'),
                                                             size=250)
        except Exception, ex:
            logging.error("Error connecting to couch: %s" % str(ex))
            self.jobsdatabase = None
            self.fwjrdatabase = None
            self.jsumdatabase = None
Example #5
0
 def __init__(self, **options):
     dict.__init__(self)
     WMObject.__init__(self)
     self.setdefault("name", None)
     self.setdefault("files", {})
     self.update(options)
     self.collection = None
Example #6
0
    def __init__(self, config, couchDbName=None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName is None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName

        self.jobsdatabase = None
        self.fwjrdatabase = None
        self.jsumdatabase = None
        self.statsumdatabase = None

        self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
        self._connectDatabases()

        try:
            self.dashboardReporter = DashboardReporter(config)
        except Exception as ex:
            logging.error("Error setting up the dashboard reporter: %s", str(ex))
            raise

        self.getCouchDAO = self.daofactory("Jobs.GetCouchID")
        self.setCouchDAO = self.daofactory("Jobs.SetCouchID")
        self.incrementRetryDAO = self.daofactory("Jobs.IncrementRetry")
        self.workflowTaskDAO = self.daofactory("Jobs.GetWorkflowTask")
        self.jobTypeDAO = self.daofactory("Jobs.GetType")
        self.updateLocationDAO = self.daofactory("Jobs.UpdateLocation")
        self.getWorkflowSpecDAO = self.daofactory("Workflow.GetSpecAndNameFromTask")

        self.maxUploadedInputFiles = getattr(self.config.JobStateMachine, 'maxFWJRInputFiles', 1000)
        self.workloadCache = {}
        return
Example #7
0
 def testMakeList(self):
     """
     Testcase for the makelist method of the WMObject Class
     """
     dummyWMObject = WMObject()
     #First case: Argument is already a list
     l = [1, 2, 3]
     assert dummyWMObject.makelist(l) == l, \
             'method makelist return value doesn\'t match ' \
             '- list argument test'
     #Second case: Argument is not a list
     a = 'test'
     assert dummyWMObject.makelist(a) == [a], \
             'method makelist return value doesn\'t match ' \
             '- common argument test'
Example #8
0
 def testMakeSet(self):
     """
     Testcase for the makeset method of the WMObject Class
     """
     dummyWMObject = WMObject()
     #First case: Argument is already a Set
     s = set('1,2,3')
     assert dummyWMObject.makeset(s) == s, \
             'method makeset return value doesn\'t match ' \
             '- list argument test'
     #Second case: Argument is not a list
     b = [1,2,3]
     assert dummyWMObject.makeset(b) == set(b), \
         'method makeset return value doesn\'t match ' \
         '- common argument test'
Example #9
0
 def testMakeSet(self):
     """
     Testcase for the makeset method of the WMObject Class
     """
     dummyWMObject = WMObject()
     #First case: Argument is already a Set
     s = set('1,2,3')
     assert dummyWMObject.makeset(s) == s, \
             'method makeset return value doesn\'t match ' \
             '- list argument test'
     #Second case: Argument is not a list
     b = [1, 2, 3]
     assert dummyWMObject.makeset(b) == set(b), \
         'method makeset return value doesn\'t match ' \
         '- common argument test'
Example #10
0
 def testMakeList(self):
     """
     Testcase for the makelist method of the WMObject Class
     """
     dummyWMObject = WMObject()
     #First case: Argument is already a list
     l = [1,2,3]
     assert dummyWMObject.makelist(l) == l, \
             'method makelist return value doesn\'t match ' \
             '- list argument test'
     #Second case: Argument is not a list
     a = 'test'
     assert dummyWMObject.makelist(a) == [a], \
             'method makelist return value doesn\'t match ' \
             '- common argument test'
Example #11
0
    def __init__(self, config, couchDbName = None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName == None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName

        try:
            self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
            self.jobsdatabase = self.couchdb.connectDatabase("%s/jobs" % self.dbname)
            self.fwjrdatabase = self.couchdb.connectDatabase("%s/fwjrs" % self.dbname)
        except Exception, ex:
            logging.error("Error connecting to couch: %s" % str(ex))
            self.jobsdatabase = None
            self.fwjrdatabase = None            
Example #12
0
    def __init__(self, config, couchDbName = None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName == None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName

        self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
        self._connectDatabases()

        try:
            self.dashboardReporter = DashboardReporter(config)
        except Exception, ex:
            logging.error("Error setting up the \
-                          dashboard reporter: %s" % str(ex))
            raise
Example #13
0
    def __init__(self, config, couchDbName=None):
        WMObject.__init__(self, config)
        WMConnectionBase.__init__(self, "WMCore.WMBS")

        if couchDbName == None:
            self.dbname = getattr(self.config.JobStateMachine, "couchDBName")
        else:
            self.dbname = couchDbName

        self.couchdb = CouchServer(self.config.JobStateMachine.couchurl)
        self._connectDatabases()

        try:
            self.dashboardReporter = DashboardReporter(config)
        except Exception, ex:
            logging.error("Error setting up the \
-                          dashboard reporter: %s" % str(ex))
            raise
Example #14
0
    def __init__(self, alertID = None, component = None, severity = None,
                 message = None, timestamp = None):
        """
        ___init___

        Initialize the five data members:
          alertID
          component
          severity
          message
          timestamp
        """
        dict.__init__(self)
        WMObject.__init__(self)

        self.alertID = alertID
        self.component = component
        self.severity = severity
        self.message = message
        self.timestamp = timestamp        

        return
Example #15
0
 def __init__(self, runNumber=None, *newLumis):
     WMObject.__init__(self)
     self.run = runNumber
     self.eventsPerLumi = {}
     self.extendLumis(newLumis)
Example #16
0
 def __init__(self, runNumber=None, *newLumis):
     WMObject.__init__(self)
     self.run = runNumber
     self.eventsPerLumi = {}
     self.extendLumis(newLumis)
Example #17
0
 def __init__(self, runNumber = None, *newLumis):
     WMObject.__init__(self)
     self.run = runNumber
     self.lumis = []
     self.lumis.extend(newLumis)
Example #18
0
 def __init__(self, runNumber=None, *newLumis):
     WMObject.__init__(self)
     self.run = runNumber
     self.lumis = []
     self.lumis.extend(newLumis)