sunithabeeram commented on a change in pull request #3671: Make different
PinotFS concrete classes have the same behaviors
URL: https://github.com/apache/incubator-pinot/pull/3671#discussion_r246850900
##########
File path:
pinot-hadoop-filesystem/src/main/java/com/linkedin/pinot/filesystem/HadoopPinotFS.java
##########
@@ -97,39 +109,93 @@ public boolean move(URI srcUri, URI dstUri, boolean
overwrite) throws IOExceptio
*/
@Override
public boolean copy(URI srcUri, URI dstUri) throws IOException {
- Path source = new Path(srcUri);
- Path target = new Path(dstUri);
- RemoteIterator<LocatedFileStatus> sourceFiles =
_hadoopFS.listFiles(source, true);
- if (sourceFiles != null) {
- while (sourceFiles.hasNext()) {
- boolean succeeded = FileUtil.copy(_hadoopFS,
sourceFiles.next().getPath(), _hadoopFS, target, true, _hadoopConf);
- if (!succeeded) {
- return false;
+ if (!exists(srcUri)) {
+ LOGGER.warn("Source {} does not exist", srcUri);
+ return false;
+ }
+ if (srcUri.equals(dstUri)) {
Review comment:
What if srcUri is a directory and has files that actually need to copied
over?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]