Hadoop Version in AWS Map Reduce

posted under , , , by prasanna
Creating job flows using AWS MapReduce's GUI is pretty simple and very straight forward. But i wanted to use Java SDK to create/run jobs in MapReduce. I could successfully able set up the job and configured all the parameters except for a weird error.

java.lang.NoSuchMethodError: org.apache.hadoop.mapred.JobConf.setBooleanIfUnset(Ljava/lang/String;Z)V

I was constantly getting this error while running the job. Initially i had no idea why this error occurs and none of the forum talks about it either. Then i figured out that the default Hadoop version used by the Ec2 instances was 0.18 and i was expecting 0.20. Interestingly i didn't face this issue when i did it through GUI.

As a solution i need to explicitly set the version number as 0.20 to the Instances object so that it will use the same while running the job.

JobFlowInstancesConfig instances = new JobFlowInstancesConfig();
instances.setHadoopVersion("0.20");

Install Custom JAR files in Samsung Corby Pro

posted under , by prasanna
Installing jar applications using Corby Pro is not straightforward. I tried multiple ways and finally found an easy solution !!!

In your PC.
* Download a jar ( Check whether it will work with Smasung Corby)
* Create a HTML file as mentioned below.


* Now transfer both these files to your mobile phone. (Make sure you have both these files in the same location/folder)

In your Mobile:
* Navigate to your HTML file and click to open it on your browser.
* You can see a link on your browser with the Jar Name you specified in the HTML.
* Click on the link and you are done !!!

SAX parser characters() method.

posted under , by prasanna
Was playing around SAX parsing some Gigs of XML file :) Here are few leanings from the game.

My intention was to read values between a corresponding tag. I initially went after using characters() in SAX parser which actually worked fine for initial feeds. But as i keep increasing the size of the XMLs and if the size of the tagContent was large the problem arises. characters() function not always gives back the entire value in a single shot. It may return the value in multiple chunks. So need to be careful in assigning and using the values from characters() method.

So the better way to use characters() method is to keep appending all the values to a buffer and use the value in the corresponding end tag section. Also need to make sure that the buffer has to be flushed in the corresponding start element.

Sample Xml:



Sample SAX handler code to print the Names:

Initial Code: (Works fine for small values & small files)


Final Code:

top