Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ psql -h file_catalog -d vospace_testdb -U postgres ``` 3. You can now perform a query, for example show all the tuples of the **node** table displaying some fields: ``` vospace_testdb=# SELECT node_id, path, name, parent_path, type, owner_id, content_md5, async_trans, sticky FROM node; vospace_testdb=# SELECT node_id, path, name, parent_path, type, creator_id, content_md5, async_trans, sticky FROM node; ``` You can perform whatever query also on the other tables: *deleted_node*, *storage*, *location*, *job* and *users*. transfer_service/db_connector.py +5 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ class DbConnector(object): JOIN node n ON p.node_id = n.node_id JOIN location l ON n.location_id = l.location_id JOIN storage s ON s.storage_id = l.storage_src_id JOIN users u ON u.user_id = n.owner_id JOIN users u ON u.user_id = n.creator_id WHERE p.vos_path = %s; """, (vospacePath,)) Loading Loading @@ -139,12 +139,12 @@ class DbConnector(object): cursor = conn.cursor(cursor_factory = RealDictCursor) cursor.execute(""" WITH all_nodes AS ( SELECT name, os_name, node_id, parent_path, path, relative_path, owner_id, location_id, null as deleted_on, null as phy_deleted_on FROM node SELECT name, os_name, node_id, parent_path, path, relative_path, creator_id, location_id, null as deleted_on, null as phy_deleted_on FROM node UNION SELECT name, os_name, node_id, parent_path, path(parent_path, node_id) AS path, path(parent_relative_path, node_id) AS relative_path, owner_id, location_id, deleted_on, phy_deleted_on SELECT name, os_name, node_id, parent_path, path(parent_path, node_id) AS path, path(parent_relative_path, node_id) AS relative_path, creator_id, location_id, deleted_on, phy_deleted_on FROM deleted_node ) SELECT an.node_id, base_path || '/' || owner_id as os_base_path, os_path AS os_rel_path, an.deleted_on, an.phy_deleted_on SELECT an.node_id, base_path || '/' || creator_id as os_base_path, os_path AS os_rel_path, an.deleted_on, an.phy_deleted_on FROM ( SELECT node_id, '/' || string_agg(name, '/') AS os_path FROM ( Loading Loading @@ -653,11 +653,10 @@ class DbConnector(object): type, location_id, busy_state, owner_id, creator_id, content_length, content_md5) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s); """, (parentLtreePath, parentLtreeRelativePath, Loading @@ -666,7 +665,6 @@ class DbConnector(object): node.type, node.locationId, node.busyState, node.ownerID, node.creatorID, node.contentLength, node.contentMD5,)) Loading transfer_service/import_amqp_server.py +0 −2 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ class ImportAMQPServer(AMQPServer): cnode.setParentPath(parentPath) locationId = dbConn.getLocationId(storageId) cnode.setLocationId(locationId) cnode.setOwnerID(userId) cnode.setCreatorID(userId) cnode.setContentLength(0) if not dbConn.nodeExists(cnode): Loading Loading @@ -192,7 +191,6 @@ class ImportAMQPServer(AMQPServer): storageId = dbConn.getStorageId(pathPrefix) locationId = dbConn.getLocationId(storageId) dnode.setLocationId(locationId) dnode.setOwnerID(userId) dnode.setCreatorID(userId) dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(md5calc.getMD5(file)) Loading transfer_service/node.py +0 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ class Node(object): self.asyncTrans = None self.sticky = None self.busyState = None self.ownerID = None self.creatorID = None self.groupRead = [] self.groupWrite = [] Loading Loading @@ -76,9 +75,6 @@ class Node(object): def setBusyState(self, busyState): self.busyState = busyState def setOwnerID(self, ownerID): self.ownerID = ownerID def setCreatorID(self, creatorID): self.creatorID = creatorID Loading transfer_service/store_preprocessor.py +0 −2 Original line number Diff line number Diff line Loading @@ -137,7 +137,6 @@ class StorePreprocessor(TaskExecutor): locationId = self.dbConn.getLocationId(self.storageId) cnode.setLocationId(locationId) cnode.setBusyState(True) cnode.setOwnerID(self.userId) cnode.setCreatorID(self.userId) cnode.setContentLength(0) if not self.dbConn.nodeExists(cnode): Loading Loading @@ -166,7 +165,6 @@ class StorePreprocessor(TaskExecutor): locationId = self.dbConn.getLocationId(self.storageId) dnode.setLocationId(locationId) dnode.setBusyState(True) dnode.setOwnerID(self.userId) dnode.setCreatorID(self.userId) dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(self.md5calc.getMD5(file)) Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -131,7 +131,7 @@ psql -h file_catalog -d vospace_testdb -U postgres ``` 3. You can now perform a query, for example show all the tuples of the **node** table displaying some fields: ``` vospace_testdb=# SELECT node_id, path, name, parent_path, type, owner_id, content_md5, async_trans, sticky FROM node; vospace_testdb=# SELECT node_id, path, name, parent_path, type, creator_id, content_md5, async_trans, sticky FROM node; ``` You can perform whatever query also on the other tables: *deleted_node*, *storage*, *location*, *job* and *users*.
transfer_service/db_connector.py +5 −7 Original line number Diff line number Diff line Loading @@ -79,7 +79,7 @@ class DbConnector(object): JOIN node n ON p.node_id = n.node_id JOIN location l ON n.location_id = l.location_id JOIN storage s ON s.storage_id = l.storage_src_id JOIN users u ON u.user_id = n.owner_id JOIN users u ON u.user_id = n.creator_id WHERE p.vos_path = %s; """, (vospacePath,)) Loading Loading @@ -139,12 +139,12 @@ class DbConnector(object): cursor = conn.cursor(cursor_factory = RealDictCursor) cursor.execute(""" WITH all_nodes AS ( SELECT name, os_name, node_id, parent_path, path, relative_path, owner_id, location_id, null as deleted_on, null as phy_deleted_on FROM node SELECT name, os_name, node_id, parent_path, path, relative_path, creator_id, location_id, null as deleted_on, null as phy_deleted_on FROM node UNION SELECT name, os_name, node_id, parent_path, path(parent_path, node_id) AS path, path(parent_relative_path, node_id) AS relative_path, owner_id, location_id, deleted_on, phy_deleted_on SELECT name, os_name, node_id, parent_path, path(parent_path, node_id) AS path, path(parent_relative_path, node_id) AS relative_path, creator_id, location_id, deleted_on, phy_deleted_on FROM deleted_node ) SELECT an.node_id, base_path || '/' || owner_id as os_base_path, os_path AS os_rel_path, an.deleted_on, an.phy_deleted_on SELECT an.node_id, base_path || '/' || creator_id as os_base_path, os_path AS os_rel_path, an.deleted_on, an.phy_deleted_on FROM ( SELECT node_id, '/' || string_agg(name, '/') AS os_path FROM ( Loading Loading @@ -653,11 +653,10 @@ class DbConnector(object): type, location_id, busy_state, owner_id, creator_id, content_length, content_md5) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s); VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s); """, (parentLtreePath, parentLtreeRelativePath, Loading @@ -666,7 +665,6 @@ class DbConnector(object): node.type, node.locationId, node.busyState, node.ownerID, node.creatorID, node.contentLength, node.contentMD5,)) Loading
transfer_service/import_amqp_server.py +0 −2 Original line number Diff line number Diff line Loading @@ -155,7 +155,6 @@ class ImportAMQPServer(AMQPServer): cnode.setParentPath(parentPath) locationId = dbConn.getLocationId(storageId) cnode.setLocationId(locationId) cnode.setOwnerID(userId) cnode.setCreatorID(userId) cnode.setContentLength(0) if not dbConn.nodeExists(cnode): Loading Loading @@ -192,7 +191,6 @@ class ImportAMQPServer(AMQPServer): storageId = dbConn.getStorageId(pathPrefix) locationId = dbConn.getLocationId(storageId) dnode.setLocationId(locationId) dnode.setOwnerID(userId) dnode.setCreatorID(userId) dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(md5calc.getMD5(file)) Loading
transfer_service/node.py +0 −4 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ class Node(object): self.asyncTrans = None self.sticky = None self.busyState = None self.ownerID = None self.creatorID = None self.groupRead = [] self.groupWrite = [] Loading Loading @@ -76,9 +75,6 @@ class Node(object): def setBusyState(self, busyState): self.busyState = busyState def setOwnerID(self, ownerID): self.ownerID = ownerID def setCreatorID(self, creatorID): self.creatorID = creatorID Loading
transfer_service/store_preprocessor.py +0 −2 Original line number Diff line number Diff line Loading @@ -137,7 +137,6 @@ class StorePreprocessor(TaskExecutor): locationId = self.dbConn.getLocationId(self.storageId) cnode.setLocationId(locationId) cnode.setBusyState(True) cnode.setOwnerID(self.userId) cnode.setCreatorID(self.userId) cnode.setContentLength(0) if not self.dbConn.nodeExists(cnode): Loading Loading @@ -166,7 +165,6 @@ class StorePreprocessor(TaskExecutor): locationId = self.dbConn.getLocationId(self.storageId) dnode.setLocationId(locationId) dnode.setBusyState(True) dnode.setOwnerID(self.userId) dnode.setCreatorID(self.userId) dnode.setContentLength(os.path.getsize(file)) dnode.setContentMD5(self.md5calc.getMD5(file)) Loading