Commit 8332fbbd authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Replaced 'owner_id' with 'creator_id' for VOSpace nodes.

parent 92254cc5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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*.
+5 −7
Original line number Diff line number Diff line
@@ -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,))
@@ -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 (
@@ -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,
@@ -666,7 +665,6 @@ class DbConnector(object):
                     node.type,
                     node.locationId,
                     node.busyState,
                     node.ownerID,
                     node.creatorID,
                     node.contentLength,
                     node.contentMD5,))
+0 −2
Original line number Diff line number Diff line
@@ -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):
@@ -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))
+0 −4
Original line number Diff line number Diff line
@@ -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 = []
@@ -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

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