Google App Engine for Java

April 20, 2009

By now I am sure everyone has heard that Google App Engine has supported Java and this is totally exciting for Java developers including myself.  Not only Java is supported, but one can use JPA to store/retrieve data from Google DataStore.  The current support has pretty much most of what one needs to build a useful Java web based application running on Google App Engine.

The next thing we need is some MVC framework for the presentation tier.  Surprisingly, there is a lot of folks trying to  use Spring MVC and Spring framework.  This seems to make sense because Spring Framework provides both web-tier support and back-send support like JPA integration and transaction management.  Maybe that’s why I haven’t seen many folks using Struts or JSF with Google App Engine.

There is a lot of buzz on google-appengine-java-group forum. Folks are trying out different technologies and exchanging tips and tricks.

As for myself, I ported the JDO Guestbook example to use Spring MVC + JPA and it is working just fine.  Check it out when you get a chance.

From what I have been seeing, the following technologies are working on GAE:

Spring MVC, Tile 2.0.7.

One of the most frustrating things that most folks encountered is that their GAE applications work on their local box and it doesn’t work when running on GAE production.  Most of the time it is related to security issue.  GAE allows a subset of JRE classes and their white list is on their site.

I have an application in mind and I will be busy in the next several weeks developing it.  Stay tune.


My First Writable With Hadoop

October 20, 2008

Hadoop uses a simple and efficient serialization protocol to serialize data between the map and reduce steps.  There is a lot going on between these two steps, but this article is not about that.  Rather it focuses on what a developer needs to know in order to write a custom Writable class.  Just for the folks that are new to MapReduce in Hadoop, the OutputCollector in the Map and Reduce step accepts only the value as of type Writable.

Writable is an interface in Hadoop and it has two methods: void readFields(DataInput in) and void write(DataOutput out).  If you browse Hadoop Javadocs, ther are roughly about 43 classes in Hadoop that implements the Writable interface.

Depending on what your MapReduce application needs, one of the out-of-box Writables will do the job, but if there isn’t one, then it is fairly straight forward to write a custom Writable.  That’s what I had to do for my project.  What I discovered and there isn’t that much documentation on it is in addition to the two methods defined in the Writable interface, you also need to implement the toString() method if you want the data in your custom Writable to appear in the output file (this took me sometime to figure out).

One of the interesting Writables is the GenericWritable.  This comes in handy when the Map and Combiner output the same key type, but different value type.  The requirement in Hadoop is the values that are mapped out to reduce, only one value type is allowed.  The GenericWritable basically helps you wrap instances of value of different types.  See GenericWritable JavaDoc for more details.


Awaken Your Entrepreneurial Spirit

September 10, 2008

Most of us have some amount of entrepreneurial blood in our body. It is good to awake this spirit once in a while to spice up our work life and our creativity.

Last night I attended a meeting hosted by The Silicon Valley NewTech Meetup group and it was a blast (the event is free by the way). I came early and was able to grab a seat. The room was packed by 7pm and those came in late had to stand along the walls. The first hour of the meeting was for young Web 2.0 startups to demo their idea and the fruits of their labor and the second hour was for announcements and mingling.

Four companies did the demo of their product/website. The business ideas from these four companies were very different. You can checked them out at the website above.

It was amazing to see the entrepreneurial spirit flying around the room during the mingling hour. Peoples were exchanging business cards, business ideas, and questions and answers. There were about 300 to 400 people, so it was pretty loud. You basically had to stand pretty close to the person you are talking to in order to hear them.

I met one musician, who has an interesting idea, and he is looking for folks to help him out on the technical side as well as on the marketing side.

I was really glad I attended the meeting last night and planning to go to next month’s meeting. I felt more energized after hanging around with the attendees and may be something good will happen. Let’s hope :)


10 Tips For Success Career

May 1, 2008

I found an old email in my mail box dated back in 1999, but the content is still pretty applicable. The content of the email contains 10 tips for a successful career. Since I haven’t really taken all those tips seriously over the years, it is no surprise that my career is not as successful as it can be :) Looking back though, I can see that I unconsciously practiced some of those tips and I can totally say the pay off is good and led to unexpected pleasant surprises. So for the next 5 years, I am planning to take these tips seriously and constantly going back to them for reminders.

Here are the tips:

  1. Don’t wait for permissions
  2. Don’t burn bridges
  3. Respect others
  4. Be a team player
  5. Be Flexible
  6. Have confidence in your decision
  7. Learn technologies
  8. Find a champion
  9. Be both patient and tenacious
  10. Thinks two steps ahead

There is one tip that I would like to add:

11. Have a health disregard for the impossible

Love to hear your career tips.