aspose file tools*
The moose likes Hadoop and the fly likes Mapr using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Hadoop
Bookmark "Mapr using java" Watch "Mapr using java" New topic
Author

Mapr using java

bharath phatak
Greenhorn

Joined: Jul 28, 2011
Posts: 7
Hi All,

I am new to Hadoop, Mapr and Pivotal. I have written java code to write into pivotal but facing issue while writing into Mapr.

public class HadoopFileSystemManager {

public void writeFile(String filePath,String data) throws IOException, URISyntaxException {
Path fPath = new Path(filePath);
String url = url = "hdfs://"+ip+":"+"8020";
FileSystem fs = FileSystem.get(new URI(url),new Configuration());
System.out.println(fs.getWorkingDirectory());
FSDataOutputStream writeStream = fs.create(fPath);
writeStream.writeChars(data);
writeStream.close();
}

}


This code works fine with pivoatal but fails with Mapr.

For Mapr i am using port = 7222.
I am getting the following error
"An existing connection was forcibly closed by the remote host"

Please let me know if am using the right port or anything needs to be changed in the code specific to Mapr.

I have stopped the iptables.

Any info is much appreciated.

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapr using java