Created
February 26, 2014 11:26
-
-
Save yashk/9227872 to your computer and use it in GitHub Desktop.
HDFS - FileCopyWithProgress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FileCopyWithProgress { | |
public static void main(String[] args) throws Exception { | |
String localSrc = args[0]; | |
String dst = args[1]; | |
InputStream in = new BufferedInputStream(new FileInputStream(localSrc)); | |
Configuration conf = new Configuration(); | |
FileSystem fs = FileSystem.get(URI.create(dst), conf); | |
OutputStream out = fs.create(new Path(dst), new Progressable() { | |
public void progress() { | |
System.out.print("."); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment