This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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
 
Similar Threads
problem displaying images from files in Firefox
how to read files from remote system
displaying loading image on clicking a link or Node
saving file path from servlet in mysql
how to access remote files