WebHosting

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

How to Enable and Configure Remote Desktop (RDP) on Ubuntu 24.04.4 LTS

Remote Desktop Protocol (RDP) support in Ubuntu has become considerably easier with the GNOME Remote Desktop stack included in modern Ubuntu...