[
https://issues.apache.org/jira/browse/HDFS-16024?focusedWorklogId=596244&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-596244
]
ASF GitHub Bot logged work on HDFS-16024:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 13/May/21 16:48
Start Date: 13/May/21 16:48
Worklog Time Spent: 10m
Work Description: goiri commented on a change in pull request #3009:
URL: https://github.com/apache/hadoop/pull/3009#discussion_r631950765
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
##########
@@ -588,6 +589,19 @@ public long getPreferredBlockSize(String src) throws
IOException {
return rpcClient.invokeSequential(locations, method, Long.class, null);
}
+ /**
+ * Use the combination of src locations and dst to return RemoteParam.
+ */
+ static private RemoteParam getRenameDestWithTrash(
Review comment:
private static the other way.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
##########
@@ -588,6 +589,19 @@ public long getPreferredBlockSize(String src) throws
IOException {
return rpcClient.invokeSequential(locations, method, Long.class, null);
}
+ /**
+ * Use the combination of src locations and dst to return RemoteParam.
+ */
+ static private RemoteParam getRenameDestWithTrash(
Review comment:
And again, why is this method called WithTrash? I don't see any trash
related code in this method.
##########
File path:
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterClientProtocol.java
##########
@@ -596,13 +610,20 @@ public boolean rename(final String src, final String dst)
final List<RemoteLocation> srcLocations =
rpcServer.getLocationsForPath(src, true, false);
- final List<RemoteLocation> dstLocations =
- rpcServer.getLocationsForPath(dst, false, false);
- // srcLocations may be trimmed by getRenameDestinations()
+ final String trashRoot = FileSystem.USER_HOME_PREFIX + "/" +
+ RouterRpcServer.getRemoteUser().getUserName() + "/" +
+ FileSystem.TRASH_PREFIX;
+ RemoteParam dstParam;
final List<RemoteLocation> locs = new LinkedList<>(srcLocations);
- RemoteParam dstParam = getRenameDestinations(locs, dstLocations);
- if (locs.isEmpty()) {
- return rbfRename.routerFedRename(src, dst, srcLocations, dstLocations);
+ if (dst.startsWith(trashRoot)) {
Review comment:
You could put this in a method:
isTrashPath(dest)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 596244)
Time Spent: 1.5h (was: 1h 20m)
> RBF: Rename data to the Trash should be based on src locations
> --------------------------------------------------------------
>
> Key: HDFS-16024
> URL: https://issues.apache.org/jira/browse/HDFS-16024
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: rbf
> Affects Versions: 3.4.0
> Reporter: zhu
> Assignee: zhu
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> 1.When deleting data to the Trash without configuring a mount point for the
> Trash, the Router should recognize and move the data to the Trash
> 2.When the user’s trash can is configured with a mount point and is different
> from the NS of the deleted directory, the router should identify and move the
> data to the trash can of the current user of src
> The same is true for using ViewFs mount points, I think we should be
> consistent with it
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]