From 12bcff38a38b0334236c6cc1997ee1ea96a77d2a Mon Sep 17 00:00:00 2001 From: Cristiano Urban Date: Thu, 17 Jun 2021 16:36:48 +0200 Subject: [PATCH] Removed code related to the 'busy_state' node attribute. Signed-off-by: Cristiano Urban --- transfer_service/db_connector.py | 20 +------------------- transfer_service/import_executor.py | 2 -- transfer_service/node.py | 4 ---- transfer_service/store_executor.py | 1 - transfer_service/store_preprocessor.py | 2 -- 5 files changed, 1 insertion(+), 28 deletions(-) diff --git a/transfer_service/db_connector.py b/transfer_service/db_connector.py index 58c27b3..4ba9a38 100644 --- a/transfer_service/db_connector.py +++ b/transfer_service/db_connector.py @@ -626,12 +626,11 @@ class DbConnector(object): location_id, async_trans, sticky, - busy_state, job_id, creator_id, content_length, content_md5) - VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) + VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) ON CONFLICT DO NOTHING RETURNING node_id; @@ -644,7 +643,6 @@ class DbConnector(object): node.locationId, node.asyncTrans, node.sticky, - node.busyState, node.jobId, node.creatorId, node.contentLength, @@ -675,22 +673,6 @@ class DbConnector(object): if not conn.closed: conn.rollback() - def setBusyState(self, nodeVOSPath, value): - """Sets the 'busy_state' flag for a VOSpace node.""" - with self.getConnection() as conn: - try: - cursor = conn.cursor(cursor_factory = RealDictCursor) - cursor.execute(""" - UPDATE node c SET busy_state = %s - FROM node n - WHERE c.path <@ n.path AND n.node_id = id_from_vos_path(%s); - """, - (value, nodeVOSPath,)) - conn.commit() - except Exception as e: - if not conn.closed: - conn.rollback() - def setJobId(self, nodeVOSPath, value): """Sets the 'job_id' flag for a VOSpace node.""" with self.getConnection() as conn: diff --git a/transfer_service/import_executor.py b/transfer_service/import_executor.py index 6762b27..7f30a95 100644 --- a/transfer_service/import_executor.py +++ b/transfer_service/import_executor.py @@ -103,7 +103,6 @@ class ImportExecutor(TaskExecutor): cnode.setParentPath(parentPath) locationId = self.dbConn.getLocationId(self.storageId) cnode.setLocationId(locationId) - cnode.setBusyState(False) cnode.setCreatorId(self.userId) cnode.setContentLength(0) cnode.setAsyncTrans(True) @@ -143,7 +142,6 @@ class ImportExecutor(TaskExecutor): self.storageId = self.dbConn.getStorageId(self.pathPrefix) locationId = self.dbConn.getLocationId(self.storageId) dnode.setLocationId(locationId) - dnode.setBusyState(False) dnode.setCreatorId(self.userId) dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(self.md5calc.getMD5(file)) diff --git a/transfer_service/node.py b/transfer_service/node.py index 9fae5cf..340d4df 100644 --- a/transfer_service/node.py +++ b/transfer_service/node.py @@ -16,7 +16,6 @@ class Node(object): self.format = None self.asyncTrans = False self.sticky = False - self.busyState = None self.jobId = None self.creatorId = None self.groupRead = [] @@ -73,9 +72,6 @@ class Node(object): def setSticky(self, sticky): self.sticky = sticky - def setBusyState(self, busyState): - self.busyState = busyState - def setJobId(self, jobId): self.jobId = jobId diff --git a/transfer_service/store_executor.py b/transfer_service/store_executor.py index 90ba150..8c9f985 100644 --- a/transfer_service/store_executor.py +++ b/transfer_service/store_executor.py @@ -94,7 +94,6 @@ class StoreExecutor(TaskExecutor): for nodeVOSPath in self.nodeList: out.write(f"nodeListElement: {nodeVOSPath}\n") self.dbConn.setAsyncTrans(nodeVOSPath, True) - self.dbConn.setBusyState(nodeVOSPath, False) self.dbConn.setJobId(nodeVOSPath, None) self.jobObj.setPhase("COMPLETED") self.dbConn.setPhase(self.jobId, "COMPLETED") diff --git a/transfer_service/store_preprocessor.py b/transfer_service/store_preprocessor.py index 8c57f3a..9ed60f6 100644 --- a/transfer_service/store_preprocessor.py +++ b/transfer_service/store_preprocessor.py @@ -152,7 +152,6 @@ class StorePreprocessor(TaskExecutor): cnode.setParentPath(basePath) locationId = self.dbConn.getLocationId(self.storageId) cnode.setLocationId(locationId) - cnode.setBusyState(True) cnode.setJobId(self.jobId) cnode.setCreatorId(self.userId) cnode.setContentLength(0) @@ -188,7 +187,6 @@ class StorePreprocessor(TaskExecutor): dnode.setParentPath(basePath) locationId = self.dbConn.getLocationId(self.storageId) dnode.setLocationId(locationId) - dnode.setBusyState(True) dnode.setJobId(self.jobId) dnode.setCreatorId(self.userId) dnode.setContentLength(os.path.getsize(file)) -- GitLab