reqmon 2.3.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Utils/CPMetrics.py +270 -0
- Utils/CertTools.py +62 -0
- Utils/EmailAlert.py +50 -0
- Utils/ExtendedUnitTestCase.py +62 -0
- Utils/FileTools.py +182 -0
- Utils/IteratorTools.py +80 -0
- Utils/MathUtils.py +31 -0
- Utils/MemoryCache.py +119 -0
- Utils/Patterns.py +24 -0
- Utils/Pipeline.py +137 -0
- Utils/PortForward.py +97 -0
- Utils/ProcessStats.py +103 -0
- Utils/PythonVersion.py +17 -0
- Utils/Signals.py +36 -0
- Utils/TemporaryEnvironment.py +27 -0
- Utils/Throttled.py +227 -0
- Utils/Timers.py +130 -0
- Utils/Timestamps.py +86 -0
- Utils/TokenManager.py +143 -0
- Utils/Tracing.py +60 -0
- Utils/TwPrint.py +98 -0
- Utils/Utilities.py +308 -0
- Utils/__init__.py +11 -0
- WMCore/Algorithms/Permissions.py +27 -0
- WMCore/Algorithms/__init__.py +7 -0
- WMCore/Cache/GenericDataCache.py +98 -0
- WMCore/Cache/WMConfigCache.py +572 -0
- WMCore/Cache/__init__.py +0 -0
- WMCore/Configuration.py +651 -0
- WMCore/DataStructs/File.py +177 -0
- WMCore/DataStructs/Fileset.py +140 -0
- WMCore/DataStructs/Job.py +182 -0
- WMCore/DataStructs/JobGroup.py +142 -0
- WMCore/DataStructs/JobPackage.py +49 -0
- WMCore/DataStructs/LumiList.py +734 -0
- WMCore/DataStructs/Mask.py +219 -0
- WMCore/DataStructs/Pickleable.py +24 -0
- WMCore/DataStructs/Run.py +256 -0
- WMCore/DataStructs/Subscription.py +175 -0
- WMCore/DataStructs/WMObject.py +47 -0
- WMCore/DataStructs/WorkUnit.py +112 -0
- WMCore/DataStructs/Workflow.py +60 -0
- WMCore/DataStructs/__init__.py +8 -0
- WMCore/Database/CMSCouch.py +1349 -0
- WMCore/Database/CouchUtils.py +118 -0
- WMCore/Database/__init__.py +9 -0
- WMCore/Lexicon.py +836 -0
- WMCore/REST/Auth.py +202 -0
- WMCore/REST/CherryPyPeriodicTask.py +166 -0
- WMCore/REST/Error.py +333 -0
- WMCore/REST/Format.py +642 -0
- WMCore/REST/HeartbeatMonitorBase.py +90 -0
- WMCore/REST/Main.py +623 -0
- WMCore/REST/Server.py +2435 -0
- WMCore/REST/Services.py +24 -0
- WMCore/REST/Test.py +120 -0
- WMCore/REST/Tools.py +38 -0
- WMCore/REST/Validation.py +250 -0
- WMCore/REST/__init__.py +1 -0
- WMCore/ReqMgr/DataStructs/AuthzByStatus.py +113 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/CAMPAIGN_CONFIG.py +116 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/DAS_RESULT_FILTER.py +3 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/EDITABLE_SPLITTING_PARAM_CONFIG.py +42 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/UNIFIED_CONFIG.py +240 -0
- WMCore/ReqMgr/DataStructs/DefaultConfig/__init__.py +0 -0
- WMCore/ReqMgr/DataStructs/ReqMgrConfigDataCache.py +65 -0
- WMCore/ReqMgr/DataStructs/Request.py +293 -0
- WMCore/ReqMgr/DataStructs/RequestError.py +21 -0
- WMCore/ReqMgr/DataStructs/RequestStatus.py +209 -0
- WMCore/ReqMgr/DataStructs/RequestType.py +13 -0
- WMCore/ReqMgr/DataStructs/__init__.py +0 -0
- WMCore/ReqMgr/__init__.py +1 -0
- WMCore/Services/AlertManager/AlertManagerAPI.py +111 -0
- WMCore/Services/AlertManager/__init__.py +0 -0
- WMCore/Services/CRIC/CRIC.py +238 -0
- WMCore/Services/CRIC/__init__.py +0 -0
- WMCore/Services/DBS/DBS3Reader.py +1044 -0
- WMCore/Services/DBS/DBSConcurrency.py +44 -0
- WMCore/Services/DBS/DBSErrors.py +113 -0
- WMCore/Services/DBS/DBSReader.py +23 -0
- WMCore/Services/DBS/DBSUtils.py +139 -0
- WMCore/Services/DBS/DBSWriterObjects.py +381 -0
- WMCore/Services/DBS/ProdException.py +133 -0
- WMCore/Services/DBS/__init__.py +8 -0
- WMCore/Services/FWJRDB/FWJRDBAPI.py +118 -0
- WMCore/Services/FWJRDB/__init__.py +0 -0
- WMCore/Services/HTTPS/HTTPSAuthHandler.py +66 -0
- WMCore/Services/HTTPS/__init__.py +0 -0
- WMCore/Services/LogDB/LogDB.py +201 -0
- WMCore/Services/LogDB/LogDBBackend.py +191 -0
- WMCore/Services/LogDB/LogDBExceptions.py +11 -0
- WMCore/Services/LogDB/LogDBReport.py +85 -0
- WMCore/Services/LogDB/__init__.py +0 -0
- WMCore/Services/MSPileup/__init__.py +0 -0
- WMCore/Services/MSUtils/MSUtils.py +54 -0
- WMCore/Services/MSUtils/__init__.py +0 -0
- WMCore/Services/McM/McM.py +173 -0
- WMCore/Services/McM/__init__.py +8 -0
- WMCore/Services/MonIT/Grafana.py +133 -0
- WMCore/Services/MonIT/__init__.py +0 -0
- WMCore/Services/PyCondor/PyCondorAPI.py +154 -0
- WMCore/Services/PyCondor/PyCondorUtils.py +105 -0
- WMCore/Services/PyCondor/__init__.py +0 -0
- WMCore/Services/ReqMgr/ReqMgr.py +261 -0
- WMCore/Services/ReqMgr/__init__.py +0 -0
- WMCore/Services/ReqMgrAux/ReqMgrAux.py +419 -0
- WMCore/Services/ReqMgrAux/__init__.py +0 -0
- WMCore/Services/RequestDB/RequestDBReader.py +267 -0
- WMCore/Services/RequestDB/RequestDBWriter.py +39 -0
- WMCore/Services/RequestDB/__init__.py +0 -0
- WMCore/Services/Requests.py +624 -0
- WMCore/Services/Rucio/Rucio.py +1287 -0
- WMCore/Services/Rucio/RucioUtils.py +74 -0
- WMCore/Services/Rucio/__init__.py +0 -0
- WMCore/Services/RucioConMon/RucioConMon.py +128 -0
- WMCore/Services/RucioConMon/__init__.py +0 -0
- WMCore/Services/Service.py +400 -0
- WMCore/Services/StompAMQ/__init__.py +0 -0
- WMCore/Services/TagCollector/TagCollector.py +155 -0
- WMCore/Services/TagCollector/XMLUtils.py +98 -0
- WMCore/Services/TagCollector/__init__.py +0 -0
- WMCore/Services/UUIDLib.py +13 -0
- WMCore/Services/UserFileCache/UserFileCache.py +160 -0
- WMCore/Services/UserFileCache/__init__.py +8 -0
- WMCore/Services/WMAgent/WMAgent.py +63 -0
- WMCore/Services/WMAgent/__init__.py +0 -0
- WMCore/Services/WMArchive/CMSSWMetrics.py +526 -0
- WMCore/Services/WMArchive/DataMap.py +463 -0
- WMCore/Services/WMArchive/WMArchive.py +33 -0
- WMCore/Services/WMArchive/__init__.py +0 -0
- WMCore/Services/WMBS/WMBS.py +97 -0
- WMCore/Services/WMBS/__init__.py +0 -0
- WMCore/Services/WMStats/DataStruct/RequestInfoCollection.py +300 -0
- WMCore/Services/WMStats/DataStruct/__init__.py +0 -0
- WMCore/Services/WMStats/WMStatsPycurl.py +145 -0
- WMCore/Services/WMStats/WMStatsReader.py +445 -0
- WMCore/Services/WMStats/WMStatsWriter.py +273 -0
- WMCore/Services/WMStats/__init__.py +0 -0
- WMCore/Services/WMStatsServer/WMStatsServer.py +134 -0
- WMCore/Services/WMStatsServer/__init__.py +0 -0
- WMCore/Services/WorkQueue/WorkQueue.py +492 -0
- WMCore/Services/WorkQueue/__init__.py +0 -0
- WMCore/Services/__init__.py +8 -0
- WMCore/Services/pycurl_manager.py +574 -0
- WMCore/WMBase.py +50 -0
- WMCore/WMException.py +183 -0
- WMCore/WMExceptions.py +269 -0
- WMCore/WMFactory.py +76 -0
- WMCore/WMLogging.py +108 -0
- WMCore/WMStats/CherryPyThreads/CleanUpTask.py +46 -0
- WMCore/WMStats/CherryPyThreads/DataCacheUpdate.py +45 -0
- WMCore/WMStats/CherryPyThreads/HeartbeatMonitor.py +6 -0
- WMCore/WMStats/CherryPyThreads/LogDBTasks.py +29 -0
- WMCore/WMStats/CherryPyThreads/__init__.py +0 -0
- WMCore/WMStats/DataStructs/DataCache.py +92 -0
- WMCore/WMStats/DataStructs/__init__.py +0 -0
- WMCore/WMStats/Service/ActiveRequestJobInfo.py +123 -0
- WMCore/WMStats/Service/MetaDataInfo.py +26 -0
- WMCore/WMStats/Service/RequestInfo.py +127 -0
- WMCore/WMStats/Service/RestApiHub.py +51 -0
- WMCore/WMStats/Service/__init__.py +0 -0
- WMCore/WMStats/T0/CherryPyThreads/T0DataCacheUpdate.py +35 -0
- WMCore/WMStats/T0/CherryPyThreads/__init__.py +0 -0
- WMCore/WMStats/T0/Service/T0RestApiHub.py +37 -0
- WMCore/WMStats/T0/Service/__init__.py +0 -0
- WMCore/WMStats/T0/__init__.py +0 -0
- WMCore/WMStats/WebGui/FrontPage.py +59 -0
- WMCore/WMStats/WebGui/__init__.py +0 -0
- WMCore/WMStats/__init__.py +1 -0
- WMCore/Wrappers/JsonWrapper/JSONThunker.py +342 -0
- WMCore/Wrappers/JsonWrapper/__init__.py +7 -0
- WMCore/Wrappers/__init__.py +6 -0
- WMCore/__init__.py +10 -0
- reqmon-2.3.10.data/data/bin/wmc-dist-patch +15 -0
- reqmon-2.3.10.data/data/bin/wmc-dist-unpatch +8 -0
- reqmon-2.3.10.data/data/bin/wmc-httpd +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/_id +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/couchapp.json +5 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/filters/filterDeletedDocs.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/validate_doc_update.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequest/map.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/logByRequestAndThread/map.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/map.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/requests/reduce.js +1 -0
- reqmon-2.3.10.data/data/data/couchapps/LogDB/views/tstamp/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/_id +1 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/couchapp.json +5 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/filters/repfilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/updates/updaterequest.js +79 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/validate_doc_update.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/byrequest/map.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatus/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/T0Request/views/bystatusandtime/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/ColVis.css +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/font-awesome.min.css +4 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-check-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-cross-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-circle-plus-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/badge-square-check-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/cms_logo.jpeg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_100_e4f1fb_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_80_d7ebf9_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_highlight-hard_55_5c9ccc_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-bg_inset-soft_100_fcfdfd_1x100.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_217bc0_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2694e8_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_2e83ff_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_469bdd_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_6da8d5_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_cd0a0a_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_d8e7f3_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/ui-icons_f9bd01_256x240.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/images/warning-16.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery-ui-1.12.0.css +1312 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/jquery.dataTables.css +241 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/logdb.css +60 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/css/main_layout.css +565 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/FontAwesome.otf +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.eot +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.svg +565 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.ttf +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/fonts/fontawesome-webfont.woff2 +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/Sorting icons.psd +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_disabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/back_enabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/error.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/favicon.ico +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_disabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/forward_enabled.jpg +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/loader-1.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/module.caption.backg.rolledup.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/rollup.gif +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_asc_disabled.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_both.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/sort_desc_disabled.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/stable.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/images/warning.png +0 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html +105 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.min +106 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/index.html.org +125 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.ActiveRequestController.js +61 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.GenericController.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/WMStats.WorkloadSummaryController.js +12 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Controller/import.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RequestSummary.js +71 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T0/WMStats.RunSummary.js +70 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.AgentRequestSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CMSSWSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.CampaignSummary.js +28 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.ReqMgrRequest.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/T1/WMStats.RequestSummary.js +190 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Agents.js +98 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Alerts.js +21 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Campaigns.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.GenericRequests.js +728 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.History.js +78 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobDetails.js +19 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.JobSummary.js +32 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogDBData.js +93 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.LogMessage.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.SiteSummary.js +24 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Sites.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.Tasks.js +107 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats.WorkloadSummary.js +20 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/WMStats._StructBase.js +37 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/DataStruct/import.js +29 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.ActiveRequestModel.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogDetailModel.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestLogModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestModel.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T0/WMStats.RequestSearchModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ActiveRequestModel.js +9 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.ReqMgrRequestModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogDetailModel.js +18 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestLogModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/T1/WMStats.RequestSearchModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AgentModel.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.AlertModel.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.HistoryModel.js +14 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobDetailModel.js +22 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.JobSummaryModel.js +18 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats.WorkloadSummaryModel.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._AjaxModelBase.js +55 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._ModelBase.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/WMStats._RequestModelBase.js +127 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Models/import.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/WMStats.ViewModel.js +511 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/ViewModels/import.js +2 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T0/WMStats.Controls.js +117 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/T1/WMStats.Controls.js +158 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/WMStats.CommonControls.js +100 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Controls/import.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/WMStats.SiteHistoryGraph.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Graphs/import.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.CategoryDetailList.js +38 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestAlertGUI.js +128 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDataList.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestDetailList.js +68 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T0/WMStats.RequestSummaryList.js +31 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.CategoryDetailList.js +54 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestAlertGUI.js +81 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDataList.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestDetailList.js +122 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.RequestSummaryList.js +35 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/T1/WMStats.ResubmissionList.js +64 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.AgentDetailList.js +137 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.CategoryTitle.js +20 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.HTMLList.js +12 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.JobDetailList.js +178 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestLogList.js +88 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/WMStats.RequestTitle.js +33 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/HTMLList/import.js +25 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.ActiveRequestTable.js +142 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.RunSummaryTable.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/WMStats.TaskSummaryTable.js +127 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T0/addCategoryMap.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTable.js +132 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.ActiveRequestTableWithJob.js +164 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.AgentRequestSummaryTable.js +78 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CMSSWSummaryTable.js +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.CampaignSummaryTable.js +76 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.SiteSummaryTable.js +63 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/WMStats.TaskSummaryTable.js +124 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/T1/addCategoryMap.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.JobSummaryTable.js +71 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.Table.js +70 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.TableController.js +130 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/WMStats.WorkloadSummaryTable.js +62 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/Tables/import.js +26 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.CategoryMap.js +45 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/WMStats.View.IndexHTML.js +137 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/Views/import.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Ajax.js +74 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Couch.js +83 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Globals.js +200 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/WMStats.Utils.js +283 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/import-all.min.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/loader.js +27 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/global.min.js +639 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t0.min.js +4317 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/js/minified/import-all-t1.min.js +4972 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/jquery.dataTables.columnFilter.js +732 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/_attachments/lib/namespace.js +23 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/deleteFatDocFilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/filterDeletedDocs.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/filters/repfilter.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/rewrites.json +110 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/shows/redirect.js +23 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/agentInfo.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/generalFields.js +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/insertRequest.js +13 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobLogArchiveLocation.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobStateTransition.js +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/jobSummaryState.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/updates/totalStats.js +39 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStats/validate_doc_update.js +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl/views/requestAgentUrl/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl1/views/byAgentURL/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/map.erl +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl2/views/allWorkflows/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/map.erl +32 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl3/views/jobsByStatusWorkflow/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/map.erl +16 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl4/views/cooledoffRequests/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl5/views/time/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl6/views/requestHistory/reduce.erl +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/language +1 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/agentInfo/map.erl +10 -0
- reqmon-2.3.10.data/data/data/couchapps/WMStatsErl7/views/latestRequest/map.erl +11 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/index.html +44 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/histogram.js +141 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/container/tree.js +67 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/dataMap/errorData.js +69 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/htmlFormatter/listFormatter.js +79 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/js/layout/gridLayout.js +77 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/performanceHistogram.html +46 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/_attachments/style/main.css +17 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/couchapp.json +4 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/filters/repfilter.js +3 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/mustache.js +333 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lib/validate.js +29 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/completedWorkflows.js +27 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/lists/performanceHistogram.js +15 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/rewrites.json +65 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/histogramByWorkflow.js +75 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/shows/lumiMissingByWorkflow.js +97 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/histogramByWorkflow.html +126 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/templates/performanceData.html +44 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updateacdc.js +6 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/updates/updatecollection.js +5 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/validate_doc_update.js +8 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/vendor/protovis/_attachments/protovis-r3.2.js +277 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/outputDataByPrimDs/map.js +21 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/performanceDataByCampaign/map.js +19 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByInputdataset/map.js +7 -0
- reqmon-2.3.10.data/data/data/couchapps/WorkloadSummary/views/summaryByOutputdataset/map.js +7 -0
- reqmon-2.3.10.dist-info/LICENSE +202 -0
- reqmon-2.3.10.dist-info/METADATA +24 -0
- reqmon-2.3.10.dist-info/NOTICE +16 -0
- reqmon-2.3.10.dist-info/RECORD +424 -0
- reqmon-2.3.10.dist-info/WHEEL +5 -0
- reqmon-2.3.10.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Mask_
|
|
4
|
+
|
|
5
|
+
Basic Mask object that can be used to restrict the run/lumi/event range in a
|
|
6
|
+
job in two ways:
|
|
7
|
+
|
|
8
|
+
- Inclusive: The stuff within the mask is processed
|
|
9
|
+
- Exclusive: The stuff outside of the mask is processed
|
|
10
|
+
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
from builtins import range
|
|
14
|
+
from WMCore.DataStructs.Run import Run
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class Mask(dict):
|
|
18
|
+
"""
|
|
19
|
+
_Mask_
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
def __init__(self, **kwargs):
|
|
23
|
+
dict.__init__(self, **kwargs)
|
|
24
|
+
self.inclusive = True
|
|
25
|
+
self.setdefault("inclusivemask", True)
|
|
26
|
+
self.setdefault("FirstEvent", None)
|
|
27
|
+
self.setdefault("LastEvent", None)
|
|
28
|
+
self.setdefault("FirstLumi", None)
|
|
29
|
+
self.setdefault("LastLumi", None)
|
|
30
|
+
self.setdefault("FirstRun", None)
|
|
31
|
+
self.setdefault("LastRun", None)
|
|
32
|
+
self.setdefault("runAndLumis", {})
|
|
33
|
+
|
|
34
|
+
def setMaxAndSkipEvents(self, maxEvents, skipEvents):
|
|
35
|
+
"""
|
|
36
|
+
_setMaxAndSkipEvents_
|
|
37
|
+
|
|
38
|
+
Set FirstEvent & LastEvent fields as max & skip events
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
|
|
42
|
+
self['FirstEvent'] = skipEvents
|
|
43
|
+
if maxEvents is not None:
|
|
44
|
+
self['LastEvent'] = skipEvents + maxEvents
|
|
45
|
+
|
|
46
|
+
return
|
|
47
|
+
|
|
48
|
+
def setMaxAndSkipLumis(self, maxLumis, skipLumi):
|
|
49
|
+
"""
|
|
50
|
+
_setMaxAndSkipLumis
|
|
51
|
+
|
|
52
|
+
Set the Maximum number of lumi sections and the starting point
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
|
|
56
|
+
self['FirstLumi'] = skipLumi
|
|
57
|
+
self['LastLumi'] = skipLumi + maxLumis
|
|
58
|
+
|
|
59
|
+
return
|
|
60
|
+
|
|
61
|
+
def setMaxAndSkipRuns(self, maxRuns, skipRun):
|
|
62
|
+
"""
|
|
63
|
+
_setMaxAndSkipRuns
|
|
64
|
+
|
|
65
|
+
Set the Maximum number of runss and the starting point
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
|
|
69
|
+
self['FirstRun'] = skipRun
|
|
70
|
+
self['LastRun'] = skipRun + maxRuns
|
|
71
|
+
|
|
72
|
+
return
|
|
73
|
+
|
|
74
|
+
def getMaxEvents(self):
|
|
75
|
+
"""
|
|
76
|
+
_getMaxEvents_
|
|
77
|
+
|
|
78
|
+
return maxevents setting
|
|
79
|
+
|
|
80
|
+
"""
|
|
81
|
+
if self['LastEvent'] is None or self['FirstEvent'] is None:
|
|
82
|
+
return None
|
|
83
|
+
return self['LastEvent'] - self['FirstEvent'] + 1
|
|
84
|
+
|
|
85
|
+
def getMax(self, keyType=None):
|
|
86
|
+
"""
|
|
87
|
+
_getMax_
|
|
88
|
+
|
|
89
|
+
returns the maximum number of runs/events/etc of the type of the type string
|
|
90
|
+
"""
|
|
91
|
+
if 'First%s' % (keyType) not in self:
|
|
92
|
+
return None
|
|
93
|
+
if self['First%s' % (keyType)] is None or self['Last%s' % (keyType)] is None:
|
|
94
|
+
return None
|
|
95
|
+
return self['Last%s' % (keyType)] - self['First%s' % (keyType)] + 1
|
|
96
|
+
|
|
97
|
+
def addRun(self, run):
|
|
98
|
+
"""
|
|
99
|
+
_addRun_
|
|
100
|
+
|
|
101
|
+
Add a run object
|
|
102
|
+
"""
|
|
103
|
+
run.lumis.sort()
|
|
104
|
+
firstLumi = run.lumis[0]
|
|
105
|
+
lastLumi = run.lumis[0]
|
|
106
|
+
for lumi in run.lumis:
|
|
107
|
+
if lumi <= lastLumi + 1:
|
|
108
|
+
lastLumi = lumi
|
|
109
|
+
else:
|
|
110
|
+
self.addRunAndLumis(run.run, lumis=[firstLumi, lastLumi])
|
|
111
|
+
firstLumi = lumi
|
|
112
|
+
lastLumi = lumi
|
|
113
|
+
self.addRunAndLumis(run.run, lumis=[firstLumi, lastLumi])
|
|
114
|
+
return
|
|
115
|
+
|
|
116
|
+
def addRunWithLumiRanges(self, run, lumiList):
|
|
117
|
+
"""
|
|
118
|
+
_addRunWithLumiRanges_
|
|
119
|
+
|
|
120
|
+
Add to runAndLumis with call signature
|
|
121
|
+
addRunWithLumiRanges(run=run, lumiList = [[start1,end1], [start2, end2], ...]
|
|
122
|
+
"""
|
|
123
|
+
self['runAndLumis'][run] = lumiList
|
|
124
|
+
return
|
|
125
|
+
|
|
126
|
+
def addRunAndLumis(self, run, lumis=None):
|
|
127
|
+
"""
|
|
128
|
+
_addRunAndLumis_
|
|
129
|
+
|
|
130
|
+
Add runs and lumis directly
|
|
131
|
+
TODO: The name of this function is a little misleading. If you pass a list of lumis
|
|
132
|
+
it ignores the content of the list and adds a range based on the max/min in
|
|
133
|
+
the list. Missing lumis in the list are ignored.
|
|
134
|
+
|
|
135
|
+
NOTE: If the new run/lumi range overlaps with the pre-existing lumi ranges in the
|
|
136
|
+
mask, no attempt is made to merge these together. This can result in a mask
|
|
137
|
+
with duplicate lumis.
|
|
138
|
+
"""
|
|
139
|
+
lumis = lumis or []
|
|
140
|
+
if not isinstance(lumis, list):
|
|
141
|
+
lumis = list(lumis)
|
|
142
|
+
|
|
143
|
+
if run not in self['runAndLumis']:
|
|
144
|
+
self['runAndLumis'][run] = []
|
|
145
|
+
|
|
146
|
+
self['runAndLumis'][run].append([min(lumis), max(lumis)])
|
|
147
|
+
|
|
148
|
+
return
|
|
149
|
+
|
|
150
|
+
def getRunAndLumis(self):
|
|
151
|
+
"""
|
|
152
|
+
_getRunAndLumis_
|
|
153
|
+
|
|
154
|
+
Return list of active runs and lumis
|
|
155
|
+
"""
|
|
156
|
+
|
|
157
|
+
return self['runAndLumis']
|
|
158
|
+
|
|
159
|
+
def runLumiInMask(self, run, lumi):
|
|
160
|
+
"""
|
|
161
|
+
_runLumiInMask_
|
|
162
|
+
|
|
163
|
+
See if a particular runLumi is in the mask
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
if self['runAndLumis'] == {}:
|
|
167
|
+
# Empty dictionary
|
|
168
|
+
# ALWAYS TRUE
|
|
169
|
+
return True
|
|
170
|
+
|
|
171
|
+
if run not in self['runAndLumis']:
|
|
172
|
+
return False
|
|
173
|
+
|
|
174
|
+
for pair in self['runAndLumis'][run]:
|
|
175
|
+
# Go through each max and min pair
|
|
176
|
+
if pair[0] <= lumi and pair[1] >= lumi:
|
|
177
|
+
# Then the lumi is bracketed
|
|
178
|
+
return True
|
|
179
|
+
|
|
180
|
+
return False
|
|
181
|
+
|
|
182
|
+
def filterRunLumisByMask(self, runs):
|
|
183
|
+
"""
|
|
184
|
+
_filterRunLumisByMask_
|
|
185
|
+
|
|
186
|
+
Pass a Mask a list of run objects, get back a list of
|
|
187
|
+
run objects that correspond to the actual mask allowed values
|
|
188
|
+
"""
|
|
189
|
+
if self['runAndLumis'] == {}:
|
|
190
|
+
# Empty dictionary
|
|
191
|
+
# ALWAYS TRUE
|
|
192
|
+
return runs
|
|
193
|
+
|
|
194
|
+
runDict = {}
|
|
195
|
+
for r in runs:
|
|
196
|
+
if r.run in runDict:
|
|
197
|
+
runDict[r.run].extendLumis(r.lumis)
|
|
198
|
+
else:
|
|
199
|
+
runDict[r.run] = r
|
|
200
|
+
|
|
201
|
+
maskRuns = set(self["runAndLumis"].keys())
|
|
202
|
+
passedRuns = set([r.run for r in runs])
|
|
203
|
+
filteredRuns = maskRuns.intersection(passedRuns)
|
|
204
|
+
|
|
205
|
+
newRuns = set()
|
|
206
|
+
for runNumber in filteredRuns:
|
|
207
|
+
maskLumis = set()
|
|
208
|
+
for pair in self["runAndLumis"][runNumber]:
|
|
209
|
+
if pair[0] == pair[1]:
|
|
210
|
+
maskLumis.add(pair[0])
|
|
211
|
+
else:
|
|
212
|
+
maskLumis = maskLumis.union(list(range(pair[0], pair[1] + 1)))
|
|
213
|
+
|
|
214
|
+
filteredLumis = set(runDict[runNumber].lumis).intersection(maskLumis)
|
|
215
|
+
if len(filteredLumis) > 0:
|
|
216
|
+
filteredLumiEvents = [(lumi, runDict[runNumber].getEventsByLumi(lumi)) for lumi in filteredLumis]
|
|
217
|
+
newRuns.add(Run(runNumber, *filteredLumiEvents))
|
|
218
|
+
|
|
219
|
+
return newRuns
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Pickleable_
|
|
4
|
+
|
|
5
|
+
An object that can be persisted using pickle
|
|
6
|
+
|
|
7
|
+
"""
|
|
8
|
+
__all__ = []
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
12
|
+
|
|
13
|
+
class Pickleable(WMObject):
|
|
14
|
+
def save(self):
|
|
15
|
+
"""
|
|
16
|
+
Pickle the object
|
|
17
|
+
"""
|
|
18
|
+
pass
|
|
19
|
+
|
|
20
|
+
def load(self):
|
|
21
|
+
"""
|
|
22
|
+
Load the object from a pickle file
|
|
23
|
+
"""
|
|
24
|
+
pass
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
_Run_
|
|
5
|
+
|
|
6
|
+
container representing a run, and its constituent lumi sections and event counts
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import print_function
|
|
10
|
+
from future.utils import viewitems, listitems
|
|
11
|
+
|
|
12
|
+
import hashlib
|
|
13
|
+
from builtins import str as newstr, bytes as newbytes
|
|
14
|
+
from Utils.PythonVersion import PY3
|
|
15
|
+
from Utils.Utilities import encodeUnicodeToBytesConditional, encodeUnicodeToBytes
|
|
16
|
+
from WMCore.DataStructs.WMObject import WMObject
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class Run(WMObject):
|
|
20
|
+
"""
|
|
21
|
+
_Run_
|
|
22
|
+
|
|
23
|
+
Run container, is a list of lumi sections with associate event counts
|
|
24
|
+
|
|
25
|
+
TODO
|
|
26
|
+
- use the decorator `from functools import total_ordering` after
|
|
27
|
+
dropping support for python 2.6
|
|
28
|
+
- then, drop __ne__, __le__, __gt__, __ge__
|
|
29
|
+
"""
|
|
30
|
+
|
|
31
|
+
def __init__(self, runNumber=None, *newLumis):
|
|
32
|
+
WMObject.__init__(self)
|
|
33
|
+
self.run = runNumber
|
|
34
|
+
self.eventsPerLumi = {}
|
|
35
|
+
self.extendLumis(newLumis)
|
|
36
|
+
|
|
37
|
+
def __str__(self):
|
|
38
|
+
return "Run%s:%s" % (self.run, self.eventsPerLumi)
|
|
39
|
+
|
|
40
|
+
def __eq__(self, rhs):
|
|
41
|
+
"""
|
|
42
|
+
Check equality of run numbers and then underlying lumi/event dicts
|
|
43
|
+
"""
|
|
44
|
+
if not isinstance(rhs, Run):
|
|
45
|
+
return False
|
|
46
|
+
if self.run != rhs.run:
|
|
47
|
+
return False
|
|
48
|
+
return self.eventsPerLumi == rhs.eventsPerLumi
|
|
49
|
+
|
|
50
|
+
def __ne__(self, rhs):
|
|
51
|
+
return not self.__eq__(rhs)
|
|
52
|
+
|
|
53
|
+
def __lt__(self, rhs):
|
|
54
|
+
"""
|
|
55
|
+
Compare on run # first, then by lumis as a list, then by events in each lumi
|
|
56
|
+
"""
|
|
57
|
+
# check run number
|
|
58
|
+
if self.run != rhs.run:
|
|
59
|
+
return self.run < rhs.run
|
|
60
|
+
# if same run number, check list of lumi sections
|
|
61
|
+
if sorted(self.eventsPerLumi.keys()) != sorted(rhs.eventsPerLumi.keys()):
|
|
62
|
+
return sorted(self.eventsPerLumi.keys()) < sorted(rhs.eventsPerLumi.keys())
|
|
63
|
+
# if same list of lumis, check events in each lumi section
|
|
64
|
+
for lumiNumber in sorted(self.eventsPerLumi):
|
|
65
|
+
if self.eventsPerLumi[lumiNumber] == rhs.eventsPerLumi.get(lumiNumber):
|
|
66
|
+
continue
|
|
67
|
+
else:
|
|
68
|
+
return self.eventsPerLumi[lumiNumber] < rhs.eventsPerLumi.get(lumiNumber)
|
|
69
|
+
# if same run number, same lumi sections list,
|
|
70
|
+
# same events in each lumi section:
|
|
71
|
+
# then the runs are equal and __lt__ should return false
|
|
72
|
+
return False
|
|
73
|
+
|
|
74
|
+
def __le__(self, other):
|
|
75
|
+
return self.__lt__(other) or self.__eq__(other)
|
|
76
|
+
|
|
77
|
+
def __gt__(self, other):
|
|
78
|
+
return not self.__le__(other)
|
|
79
|
+
|
|
80
|
+
def __ge__(self, other):
|
|
81
|
+
return not self.__lt__(other)
|
|
82
|
+
|
|
83
|
+
def extend(self, items):
|
|
84
|
+
"""
|
|
85
|
+
Redirect to the function that already does this
|
|
86
|
+
"""
|
|
87
|
+
self.extendLumis(items)
|
|
88
|
+
return
|
|
89
|
+
|
|
90
|
+
def __add__(self, rhs):
|
|
91
|
+
"""
|
|
92
|
+
Combine two runs
|
|
93
|
+
"""
|
|
94
|
+
if self.run != rhs.run:
|
|
95
|
+
msg = "Adding together two different runs"
|
|
96
|
+
msg += "Run %s does not equal Run %s" % (self.run, rhs.run)
|
|
97
|
+
raise RuntimeError(msg)
|
|
98
|
+
|
|
99
|
+
for lumi, events in viewitems(rhs.eventsPerLumi):
|
|
100
|
+
if lumi not in self.eventsPerLumi or not self.eventsPerLumi[lumi]: # Either doesn't exist, 0, or None
|
|
101
|
+
self.eventsPerLumi[lumi] = events
|
|
102
|
+
else:
|
|
103
|
+
self.eventsPerLumi[lumi] += events
|
|
104
|
+
return self
|
|
105
|
+
|
|
106
|
+
def __iter__(self):
|
|
107
|
+
return self.eventsPerLumi.__iter__()
|
|
108
|
+
|
|
109
|
+
def __next__(self):
|
|
110
|
+
"""
|
|
111
|
+
__next__ no longer needed
|
|
112
|
+
"""
|
|
113
|
+
raise NotImplementedError
|
|
114
|
+
|
|
115
|
+
def __len__(self):
|
|
116
|
+
"""
|
|
117
|
+
Number of lumis
|
|
118
|
+
"""
|
|
119
|
+
return self.eventsPerLumi.__len__()
|
|
120
|
+
|
|
121
|
+
def __getitem__(self, key):
|
|
122
|
+
"""
|
|
123
|
+
Get the nth lumi from the list (no event count)
|
|
124
|
+
"""
|
|
125
|
+
return sorted(self.eventsPerLumi.keys()).__getitem__(key)
|
|
126
|
+
|
|
127
|
+
def __setitem__(self, key, lumi):
|
|
128
|
+
"""
|
|
129
|
+
Replace the nth lumi from the list (no event count)
|
|
130
|
+
"""
|
|
131
|
+
try:
|
|
132
|
+
oldLumi = sorted(self.eventsPerLumi.keys())[key] # Extract the lumi from the sorted list
|
|
133
|
+
del self.eventsPerLumi[oldLumi] # Delete it and add the new one
|
|
134
|
+
except IndexError:
|
|
135
|
+
pass
|
|
136
|
+
self.appendLumi(lumi)
|
|
137
|
+
|
|
138
|
+
def __delitem__(self, key):
|
|
139
|
+
try:
|
|
140
|
+
oldLumi = sorted(self.eventsPerLumi.keys())[key] # Extract the lumi from the sorted list
|
|
141
|
+
del self.eventsPerLumi[oldLumi] # Delete it
|
|
142
|
+
except IndexError:
|
|
143
|
+
pass
|
|
144
|
+
|
|
145
|
+
def __hash__(self):
|
|
146
|
+
"""
|
|
147
|
+
Calculate the value of the hash
|
|
148
|
+
|
|
149
|
+
NOTE: Python2 maxint is:
|
|
150
|
+
> python -c 'import sys; print(sys.maxint)'
|
|
151
|
+
9223372036854775807
|
|
152
|
+
so we cannot use the full range of the hexadecimal hash code because
|
|
153
|
+
it could cause an integer overflow. This is the maximum slice/value we
|
|
154
|
+
can safely use:
|
|
155
|
+
> int(15 * "f", base=16)
|
|
156
|
+
1152921504606846975
|
|
157
|
+
"""
|
|
158
|
+
if isinstance(self.run, (newstr, newbytes)):
|
|
159
|
+
value = encodeUnicodeToBytesConditional(self.run, condition=PY3)
|
|
160
|
+
else:
|
|
161
|
+
value = encodeUnicodeToBytesConditional(str(self.run), condition=PY3)
|
|
162
|
+
hashValue = hashlib.sha1(value)
|
|
163
|
+
# Generate immutable sorted list of lumis
|
|
164
|
+
frozenEvents = str(sorted(listitems(self.eventsPerLumi), key=lambda x: x[0]))
|
|
165
|
+
hashValue.update(encodeUnicodeToBytes(frozenEvents))
|
|
166
|
+
return int(hashValue.hexdigest()[:15], 16)
|
|
167
|
+
|
|
168
|
+
@property
|
|
169
|
+
def lumis(self):
|
|
170
|
+
"""
|
|
171
|
+
Property that makes existing uses of myRun.lumis function by returning a list
|
|
172
|
+
"""
|
|
173
|
+
return sorted(self.eventsPerLumi.keys())
|
|
174
|
+
|
|
175
|
+
@lumis.setter
|
|
176
|
+
def lumis(self, lumiList):
|
|
177
|
+
"""
|
|
178
|
+
Setter to allow for replacement of the lumis with a list or list of tuples
|
|
179
|
+
"""
|
|
180
|
+
self.eventsPerLumi = {} # Remove existing dictionary
|
|
181
|
+
for lumi in lumiList:
|
|
182
|
+
if isinstance(lumi, (list, tuple)):
|
|
183
|
+
self.eventsPerLumi[lumi[0]] = lumi[1]
|
|
184
|
+
else:
|
|
185
|
+
self.eventsPerLumi[lumi] = None
|
|
186
|
+
|
|
187
|
+
def extendLumis(self, lumiList):
|
|
188
|
+
"""
|
|
189
|
+
Method to replace myRun.lumis.extend() which does not work with the property
|
|
190
|
+
"""
|
|
191
|
+
for lumi in lumiList:
|
|
192
|
+
if not isinstance(lumi, (list, tuple)): # comma separated lumi numbers
|
|
193
|
+
self.eventsPerLumi[lumi] = None
|
|
194
|
+
else:
|
|
195
|
+
if isinstance(lumi, list) and not isinstance(lumi[0], tuple): # then it's a plain list
|
|
196
|
+
for l in lumi:
|
|
197
|
+
self.eventsPerLumi[l] = None
|
|
198
|
+
else:
|
|
199
|
+
if isinstance(lumi, tuple): # it's an unpacked list of tuples
|
|
200
|
+
lumi = [(lumi)]
|
|
201
|
+
# it's a list/tuple of tuples
|
|
202
|
+
for tp in lumi:
|
|
203
|
+
if tp[0] in self.eventsPerLumi and self.eventsPerLumi[tp[0]]:
|
|
204
|
+
self.eventsPerLumi[tp[0]] += tp[1] # Already exists, add events
|
|
205
|
+
else: # Doesn't exist or is 0 or None
|
|
206
|
+
self.eventsPerLumi[tp[0]] = tp[1]
|
|
207
|
+
|
|
208
|
+
def appendLumi(self, lumi):
|
|
209
|
+
"""
|
|
210
|
+
Method to replace myRun.lumis.append() which does not work with the property
|
|
211
|
+
"""
|
|
212
|
+
if isinstance(lumi, (list, tuple)) and self.eventsPerLumi[lumi[0]]: # Already exists, add events
|
|
213
|
+
self.eventsPerLumi[lumi[0]] += lumi[1]
|
|
214
|
+
elif isinstance(lumi, (list, tuple)): # Doesn't exist or is 0 or None
|
|
215
|
+
self.eventsPerLumi[lumi[0]] = lumi[1]
|
|
216
|
+
else: # Just given lumis, not events
|
|
217
|
+
if lumi not in self.eventsPerLumi: # Don't overwrite existing events
|
|
218
|
+
self.eventsPerLumi[lumi] = None
|
|
219
|
+
|
|
220
|
+
def getEventsByLumi(self, lumi):
|
|
221
|
+
"""
|
|
222
|
+
getter to select event counts by given lumi
|
|
223
|
+
"""
|
|
224
|
+
return self.eventsPerLumi.get(lumi)
|
|
225
|
+
|
|
226
|
+
def json(self):
|
|
227
|
+
"""
|
|
228
|
+
_json_
|
|
229
|
+
|
|
230
|
+
Convert to JSON friendly format. Include some information for the
|
|
231
|
+
thunker so that we can convert back.
|
|
232
|
+
"""
|
|
233
|
+
return {"Run": self.run, "Lumis": self.eventsPerLumi,
|
|
234
|
+
"thunker_encoded_json": True, "type": "WMCore.DataStructs.Run.Run"}
|
|
235
|
+
|
|
236
|
+
def __to_json__(self, thunker=None):
|
|
237
|
+
"""
|
|
238
|
+
__to_json__
|
|
239
|
+
|
|
240
|
+
This is the standard way we JSONize other objects.
|
|
241
|
+
Included here so we have a uniform method.
|
|
242
|
+
"""
|
|
243
|
+
return self.json()
|
|
244
|
+
|
|
245
|
+
def __from_json__(self, jsondata, thunker):
|
|
246
|
+
"""
|
|
247
|
+
__from_json__
|
|
248
|
+
|
|
249
|
+
Convert JSON data back into a Run object with integer lumi numbers
|
|
250
|
+
"""
|
|
251
|
+
self.run = jsondata["Run"]
|
|
252
|
+
self.eventsPerLumi = {}
|
|
253
|
+
for lumi, events in viewitems(jsondata["Lumis"]):
|
|
254
|
+
self.eventsPerLumi[int(lumi)] = events # Make the keys integers again
|
|
255
|
+
|
|
256
|
+
return self
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env python
|
|
2
|
+
"""
|
|
3
|
+
_Subscription_
|
|
4
|
+
|
|
5
|
+
workflow + fileset = subscription
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from builtins import range
|
|
9
|
+
import copy
|
|
10
|
+
|
|
11
|
+
from WMCore.DataStructs.Pickleable import Pickleable
|
|
12
|
+
from WMCore.DataStructs.Fileset import Fileset
|
|
13
|
+
|
|
14
|
+
class Subscription(Pickleable, dict):
|
|
15
|
+
def __init__(self, fileset = None, workflow = None,
|
|
16
|
+
split_algo = "FileBased", type = "Processing"):
|
|
17
|
+
if fileset == None:
|
|
18
|
+
fileset = Fileset()
|
|
19
|
+
|
|
20
|
+
self.setdefault('fileset', fileset)
|
|
21
|
+
self.setdefault('workflow', workflow)
|
|
22
|
+
self.setdefault('type', type)
|
|
23
|
+
|
|
24
|
+
self.setdefault('split_algo', split_algo)
|
|
25
|
+
|
|
26
|
+
self.available = Fileset(name=fileset.name,
|
|
27
|
+
files = fileset.getFiles())
|
|
28
|
+
|
|
29
|
+
self.acquired = Fileset(name='acquired')
|
|
30
|
+
self.completed = Fileset(name='completed')
|
|
31
|
+
self.failed = Fileset(name='failed')
|
|
32
|
+
|
|
33
|
+
def name(self):
|
|
34
|
+
return self.getWorkflow().name.replace(' ', '') + '_' + \
|
|
35
|
+
self.getFileset().name.replace(' ', '')
|
|
36
|
+
|
|
37
|
+
def getWorkflow(self):
|
|
38
|
+
return self["workflow"]
|
|
39
|
+
|
|
40
|
+
def workflowName(self):
|
|
41
|
+
if self["workflow"] == None:
|
|
42
|
+
return "Unknown"
|
|
43
|
+
return self["workflow"].name
|
|
44
|
+
|
|
45
|
+
def workflowType(self):
|
|
46
|
+
if self["workflow"] == None:
|
|
47
|
+
return "Unknown"
|
|
48
|
+
return self["workflow"].wfType
|
|
49
|
+
|
|
50
|
+
def taskName(self):
|
|
51
|
+
if self['workflow'] == None:
|
|
52
|
+
return "Unknown"
|
|
53
|
+
return self['workflow'].task
|
|
54
|
+
|
|
55
|
+
def owner(self):
|
|
56
|
+
if self['workflow'] == None:
|
|
57
|
+
return 'Unknown'
|
|
58
|
+
return self['workflow'].owner
|
|
59
|
+
|
|
60
|
+
def getFileset(self):
|
|
61
|
+
return self['fileset']
|
|
62
|
+
|
|
63
|
+
def acquireFiles(self, files = [], size=1):
|
|
64
|
+
"""
|
|
65
|
+
Return the files acquired
|
|
66
|
+
"""
|
|
67
|
+
self.acquired.commit()
|
|
68
|
+
self.available.commit()
|
|
69
|
+
self.failed.commit()
|
|
70
|
+
self.completed.commit()
|
|
71
|
+
retval = []
|
|
72
|
+
if len(files):
|
|
73
|
+
for i in files:
|
|
74
|
+
# Check each set, instead of elif, just in case something has
|
|
75
|
+
# got out of synch
|
|
76
|
+
if i in self.available.files:
|
|
77
|
+
self.available.files.remove(i)
|
|
78
|
+
if i in self.failed.files:
|
|
79
|
+
self.failed.files.remove(i)
|
|
80
|
+
if i in self.completed.files:
|
|
81
|
+
self.completed.files.remove(i)
|
|
82
|
+
self.acquired.addFile(i)
|
|
83
|
+
else:
|
|
84
|
+
if len(self.available.files) < size or size == 0:
|
|
85
|
+
size = len(self.available.files)
|
|
86
|
+
for i in range(size):
|
|
87
|
+
self.acquired.addFile(self.available.files.pop())
|
|
88
|
+
|
|
89
|
+
return self.acquired.listNewFiles()
|
|
90
|
+
|
|
91
|
+
def completeFiles(self, files):
|
|
92
|
+
"""
|
|
93
|
+
Return the number of files complete
|
|
94
|
+
"""
|
|
95
|
+
self.acquired.commit()
|
|
96
|
+
self.available.commit()
|
|
97
|
+
self.failed.commit()
|
|
98
|
+
self.completed.commit()
|
|
99
|
+
for i in files:
|
|
100
|
+
# Check each set, instead of elif, just in case something has
|
|
101
|
+
# got out of synch
|
|
102
|
+
if i in self.available.files:
|
|
103
|
+
self.available.files.remove(i)
|
|
104
|
+
if i in self.failed.files:
|
|
105
|
+
self.failed.files.remove(i)
|
|
106
|
+
if i in self.acquired.files:
|
|
107
|
+
self.acquired.files.remove(i)
|
|
108
|
+
self.completed.addFile(i)
|
|
109
|
+
|
|
110
|
+
def failFiles(self, files):
|
|
111
|
+
"""
|
|
112
|
+
Return the number of files failed
|
|
113
|
+
"""
|
|
114
|
+
self.acquired.commit()
|
|
115
|
+
self.available.commit()
|
|
116
|
+
self.failed.commit()
|
|
117
|
+
self.completed.commit()
|
|
118
|
+
for i in files:
|
|
119
|
+
# Check each set, instead of elif, just in case something has
|
|
120
|
+
# got out of synch
|
|
121
|
+
if i in self.available.files:
|
|
122
|
+
self.available.files.remove(i)
|
|
123
|
+
if i in self.completed.files:
|
|
124
|
+
self.completed.files.remove(i)
|
|
125
|
+
if i in self.acquired.files:
|
|
126
|
+
self.acquired.files.remove(i)
|
|
127
|
+
self.failed.addFile(i)
|
|
128
|
+
|
|
129
|
+
def filesOfStatus(self, status=None, doingJobSplitting = False):
|
|
130
|
+
"""
|
|
131
|
+
_filesOfStatus_
|
|
132
|
+
|
|
133
|
+
Return a Set of File objects that are associated with the subscription
|
|
134
|
+
and have a particular status.
|
|
135
|
+
"""
|
|
136
|
+
status = status.title()
|
|
137
|
+
if status == 'Available':
|
|
138
|
+
return self.available.getFiles(type='set') - \
|
|
139
|
+
(self.acquiredFiles() | self.completedFiles() | self.failedFiles())
|
|
140
|
+
elif status == 'Acquired':
|
|
141
|
+
return self.acquired.getFiles(type='set')
|
|
142
|
+
elif status == 'Completed':
|
|
143
|
+
return self.completed.getFiles(type='set')
|
|
144
|
+
elif status == 'Failed':
|
|
145
|
+
return self.failed.getFiles(type='set')
|
|
146
|
+
|
|
147
|
+
def availableFiles(self, limit = None, doingJobSplitting = False):
|
|
148
|
+
"""
|
|
149
|
+
_availableFiles_
|
|
150
|
+
|
|
151
|
+
Return a Set of files that are available for processing
|
|
152
|
+
(e.g. not already in use)
|
|
153
|
+
"""
|
|
154
|
+
if limit:
|
|
155
|
+
return list(self.filesOfStatus(status = "Available", doingJobSplitting = doingJobSplitting))[:limit]
|
|
156
|
+
else:
|
|
157
|
+
return self.filesOfStatus(status = "Available", doingJobSplitting = doingJobSplitting)
|
|
158
|
+
|
|
159
|
+
def acquiredFiles(self):
|
|
160
|
+
"""
|
|
161
|
+
Set of files marked as acquired.
|
|
162
|
+
"""
|
|
163
|
+
return self.filesOfStatus(status = "Acquired")
|
|
164
|
+
|
|
165
|
+
def completedFiles(self):
|
|
166
|
+
"""
|
|
167
|
+
Set of files marked as completed.
|
|
168
|
+
"""
|
|
169
|
+
return self.filesOfStatus(status = "Completed")
|
|
170
|
+
|
|
171
|
+
def failedFiles(self):
|
|
172
|
+
"""
|
|
173
|
+
Set of files marked as failed.
|
|
174
|
+
"""
|
|
175
|
+
return self.filesOfStatus(status = "Failed")
|