Loading transfer_service/db_connector.py +22 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,28 @@ class DbConnector(object): json.dumps(jobObj.results),)) self.conn.commit() def setStartTime(self, jobId): """Sets the job 'start_time' parameter.""" if self.conn: startTime = datetime.datetime.today().isoformat() self.cursor.execute(""" UPDATE job SET start_time = %s WHERE job_id = %s; """, (startTime, jobId,)) self.conn.commit() def setEndTime(self, jobId): """Sets the job 'end_time' parameter.""" if self.conn: endTime = datetime.datetime.today().isoformat() self.cursor.execute(""" UPDATE job SET end_time = %s WHERE job_id = %s; """, (endTime, jobId,)) self.conn.commit() def setPhase(self, jobId, phase): """Sets the job 'phase' parameter.""" if self.conn: Loading transfer_service/retrieve_executor.py +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ class RetrieveExecutor(TaskExecutor): fileList = [] self.dbConn.connect() self.dbConn.setPhase(self.jobId, "EXECUTING") self.dbConn.setStartTime(self.jobId) for vospacePath in self.nodeList: [srcPath, storageType, username, osRelPath] = self.dbConn.getOSPath(vospacePath) if storageType == "cold": Loading Loading @@ -88,6 +89,7 @@ class RetrieveExecutor(TaskExecutor): self.dbConn.setResults(self.jobId, results) self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.setEndTime(self.jobId) self.dbConn.disconnect() def cleanup(self): Loading transfer_service/store_executor.py +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ class StoreExecutor(TaskExecutor): def copyData(self): self.dbConn.connect() self.dbConn.setPhase(self.jobId, "EXECUTING") self.dbConn.setStartTime(self.jobId) srcPathPrefix = self.storageStorePath.replace("{username}", self.username) srcData = os.listdir(srcPathPrefix) destPathPrefix = self.dbConn.getStorageBasePath(self.storageId) + '/' + self.username Loading Loading @@ -78,6 +79,7 @@ class StoreExecutor(TaskExecutor): self.dbConn.setBusyState(nodeVOSPath, False); self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.setEndTime(self.jobId) out.close() self.dbConn.disconnect() Loading Loading
transfer_service/db_connector.py +22 −0 Original line number Diff line number Diff line Loading @@ -324,6 +324,28 @@ class DbConnector(object): json.dumps(jobObj.results),)) self.conn.commit() def setStartTime(self, jobId): """Sets the job 'start_time' parameter.""" if self.conn: startTime = datetime.datetime.today().isoformat() self.cursor.execute(""" UPDATE job SET start_time = %s WHERE job_id = %s; """, (startTime, jobId,)) self.conn.commit() def setEndTime(self, jobId): """Sets the job 'end_time' parameter.""" if self.conn: endTime = datetime.datetime.today().isoformat() self.cursor.execute(""" UPDATE job SET end_time = %s WHERE job_id = %s; """, (endTime, jobId,)) self.conn.commit() def setPhase(self, jobId, phase): """Sets the job 'phase' parameter.""" if self.conn: Loading
transfer_service/retrieve_executor.py +2 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ class RetrieveExecutor(TaskExecutor): fileList = [] self.dbConn.connect() self.dbConn.setPhase(self.jobId, "EXECUTING") self.dbConn.setStartTime(self.jobId) for vospacePath in self.nodeList: [srcPath, storageType, username, osRelPath] = self.dbConn.getOSPath(vospacePath) if storageType == "cold": Loading Loading @@ -88,6 +89,7 @@ class RetrieveExecutor(TaskExecutor): self.dbConn.setResults(self.jobId, results) self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.setEndTime(self.jobId) self.dbConn.disconnect() def cleanup(self): Loading
transfer_service/store_executor.py +2 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ class StoreExecutor(TaskExecutor): def copyData(self): self.dbConn.connect() self.dbConn.setPhase(self.jobId, "EXECUTING") self.dbConn.setStartTime(self.jobId) srcPathPrefix = self.storageStorePath.replace("{username}", self.username) srcData = os.listdir(srcPathPrefix) destPathPrefix = self.dbConn.getStorageBasePath(self.storageId) + '/' + self.username Loading Loading @@ -78,6 +79,7 @@ class StoreExecutor(TaskExecutor): self.dbConn.setBusyState(nodeVOSPath, False); self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") self.dbConn.setEndTime(self.jobId) out.close() self.dbConn.disconnect() Loading