title: Java Hadoop MapReduce Multiple Value
body: <p>I was trying to do a movie recommendation system and have been following this website. <a href="http://aimotion.blogspot.co.uk/2012/08/introduction-to-recommendations-with.html" rel="nofollow noreferrer">LinkHere</a></p>
  <pre><code>def count_ratings_users_freq(self, user_id, values):
  &quot;&quot;&quot;
  For each user, emit a row containing their &quot;postings&quot;
  (item,rating pairs)
  Also emit user rating sum and count for use later steps.
  output:
  userid, number of movie rated by user, rating number count, (movieid, movie rating)
  
  17    1,3,(70,3)
  35    1,1,(21,1)
  49    3,7,(19,2 21,1 70,4)
  87    2,3,(19,1 21,2)
  98    1,2,(19,2)
  &quot;&quot;&quot;
  item_count = 0
  item_sum = 0
  final = []
  for item_id, rating in values:
      item_count += 1
      item_sum += rating
      final.append((item_id, rating))
  
  yield user_id, (item_count, item_sum, final)
  </code></pre>
  <p>Is it possible to translate the above code to Java with Hadoop Map and Reduce?
  <code>userid</code> as key<br />
  <code>no. movie rated by user, rating number count, (movieid, movie ratings)</code> as value.
  Thank you!</p>