[
https://issues.apache.org/jira/browse/HADOOP-18056?focusedWorklogId=701508&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-701508
]
ASF GitHub Bot logged work on HADOOP-18056:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 28/Dec/21 12:31
Start Date: 28/Dec/21 12:31
Worklog Time Spent: 10m
Work Description: tomscut commented on a change in pull request #3825:
URL: https://github.com/apache/hadoop/pull/3825#discussion_r775885930
##########
File path:
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCpOptions.java
##########
@@ -234,7 +236,18 @@ public Path getSourceFileListing() {
public List<Path> getSourcePaths() {
return sourcePaths == null ?
- null : Collections.unmodifiableList(sourcePaths);
+ null :
+ Collections.unmodifiableList(getUniquePaths(sourcePaths));
+ }
+
+ private List<Path> getUniquePaths(List<Path> srcPaths) {
+ Set<Path> uniquePaths = new LinkedHashSet<>();
+ for (Path path : srcPaths) {
+ if (!uniquePaths.add(path)) {
+ LOG.warn("Path: {} added multiple times, Ignoring the redundant
entry.", path);
Review comment:
LGTM. Do we need to change `Ignoring` to `ignoring`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 701508)
Time Spent: 1h (was: 50m)
> DistCp: Filter duplicates in the source paths
> ---------------------------------------------
>
> Key: HADOOP-18056
> URL: https://issues.apache.org/jira/browse/HADOOP-18056
> Project: Hadoop Common
> Issue Type: Improvement
> Reporter: Ayush Saxena
> Assignee: Ayush Saxena
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h
> Remaining Estimate: 0h
>
> Add a basic filtering to remove the exact duplicate paths exposed for copying.
> In case two same srcPath say /tmp/file1 is passed in the list twice. DistCp
> fails with DuplicateFileException, post building the listing.
> Would be better if we do a basic filtering of duplicate paths.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]