Showing posts with label copy file from local disk to hdfs. Show all posts
Showing posts with label copy file from local disk to hdfs. Show all posts

Thursday, March 1, 2012

Copy file from local disk to hdfs using java

 
Local File ====== File Copy =======> hdfs file systemHadoop
 
 
Create a project in eclipse or netbeans or any editor you like and add hadoop-core.jar and create a class named PutToHdfs and put this code
 
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DistributedFileSystem;

/**
*
*
* @author shashwat
*/
public class PutToHdfs {


Featured Posts

Kali Linux Remote Desktop: Access GNOME from Windows Using Native RDP

  Kali Linux + GNOME 50 + GNOME Remote Desktop + Windows Remote Desktop (MSTSC) Getting a full GNOME desktop remotely on Kali Linux can be ...