Commit 12bcff38 authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Removed code related to the 'busy_state' node attribute.

parent 72bbfe67
Loading
Loading
Loading
Loading
+1 −19
Original line number Diff line number Diff line
@@ -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:
+0 −2
Original line number Diff line number Diff line
@@ -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))
+0 −4
Original line number Diff line number Diff line
@@ -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

+0 −1
Original line number Diff line number Diff line
@@ -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")
+0 −2
Original line number Diff line number Diff line
@@ -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))