[#57] Added support for hard links.#113
Conversation
| Map<String, String> jsonInput = new HashMap<>(); | ||
| jsonInput.put("operation", "hard_link_create"); | ||
| jsonInput.put("logical_path", linkTargetPath.toString()); | ||
| jsonInput.put("replica_number", "0"); |
There was a problem hiding this comment.
How do we want to handle cases where replica zero does not exist?
There was a problem hiding this comment.
This could be controlled via the following:
- configuration
- metadata
- genquery that selects a specific replica based on certain criteria provided by the admin
There was a problem hiding this comment.
i don't know how we could safely assume anything... doesn't it have to come from the catalog?
There was a problem hiding this comment.
Maybe it executes genquery to find the latest good replica and it creates the hard link to that?
There was a problem hiding this comment.
I think latest good replica is the answer... trying to figure out how to get that information without another trip to the catalog...
|
I'd like to get w you all and test this to make sure the core libs support
correctly
…On Thu, Jan 21, 2021, 7:05 PM Kory Draughn ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
irods-vfs-impl/src/main/java/org/irods/nfsrods/vfs/IRODSVirtualFileSystem.java
<#113 (comment)>
:
> +
+ Path linkParentPath = getPath(toInodeNumber(_parent));
+ Path linkTargetPath = getPath(toInodeNumber(_existing));
+ Path linkNamePath = linkParentPath.resolve(_target);
+
+ log_.debug("list - _parent = {}", linkParentPath); // The parent directory of _target.
+ log_.debug("list - _existing = {}", linkTargetPath); // The file or directory to link to.
+ log_.debug("list - _target = {}", _target); // The filename or absolute path of the link.
+ log_.debug("list - _subject = {}", Subjects.getUid(_subject)); // The UID of the user who executed this command.
+
+ // _parent + _target => the absolute path of the hard link.
+
+ Map<String, String> jsonInput = new HashMap<>();
+ jsonInput.put("operation", "hard_link_create");
+ jsonInput.put("logical_path", linkTargetPath.toString());
+ jsonInput.put("replica_number", "0");
Maybe it executes genquery to find the latest good replica and it creates
the hard link to that?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#113 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIL4LOV2X65UNZW3AUA65LS3C6LVANCNFSM4WDCRJXA>
.
|
|
Sure. Let me know when you'd like to do this. |
| log_.debug("list - _parent = {}", linkParentPath); // The parent directory of _target. | ||
| log_.debug("list - _existing = {}", linkTargetPath); // The file or directory to link to. | ||
| log_.debug("list - _target = {}", _target); // The filename or absolute path of the link. | ||
| log_.debug("list - _subject = {}", Subjects.getUid(_subject)); // The UID of the user who executed this command. |
| stat.setUid(userId); | ||
| stat.setGid(groupId); | ||
| stat.setNlink(1); | ||
| stat.setNlink(1); // TODO: Should hard links affect this number? |
There was a problem hiding this comment.
we'd increase it and then... decrease it somewhere else?
This PR needs to include documentation about the hard links REP. This also needs to be tested against the version of WinSCP that triggered this change.