title: MapReduce programming
body: <p>I 've done this code on java which collects various information about photos and extracts the results to a text file.
  I would like to convert this program to function with the MapReduce model.
  I am a newbie on MapReduce programming. Any help would be very appreciated!!
  Thank you</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  import java.net.*;
  
  import javax.xml.parsers.ParserConfigurationException;
  
  import org.xml.sax.SAXException;
  
  import com.aetrion.flickr.people.User;
  import com.aetrion.flickr.photos.Photo;
  import com.aetrion.flickr.photos.PhotoList;
  import com.aetrion.flickr.photos.PhotosInterface;
  import com.aetrion.flickr.photos.SearchParameters;
  import com.aetrion.flickr.photosets.PhotosetsInterface;
  import com.aetrion.flickr.test.TestInterface;
  import com.aetrion.flickr.people.PeopleInterface;
  import com.aetrion.flickr.groups.*;
  import com.aetrion.flickr.groups.pools.*;
  
  
  import com.aetrion.flickr.*;
  
  public class example2{
  
  public example2() {
  
  
  
  }
  
  /**
  * @param args
  * @throws FlickrException
  * @throws SAXException
  * @throws IOException
  * @throws ParserConfigurationException
  */
  
  @SuppressWarnings("deprecation")
  public static void main(String[] args) throws IOException, SAXException, FlickrException, ParserConfigurationException { // TODO Auto-generated method stub
  
  FileWriter out = new FileWriter("photos.txt");
  
  //Set api key
  String key="apikey";
  String svr="www.flickr.com";
  REST rest=new REST();
  rest.setHost(svr);
  
  //initialize Flickr object with key and rest
  Flickr flickr=new Flickr(key,rest);
  Flickr.debugStream=false;
  
  //initialize SearchParameter object, this object stores the search keyword
  SearchParameters searchParams=new SearchParameters();
  searchParams.setSort(SearchParameters.INTERESTINGNESS_DESC);
  searchParams.setGroupId("group_id");
  
  //Initialize PhotosInterface object
  PhotosInterface photosInterface=flickr.getPhotosInterface();
  //Execute search with entered tags
  PhotoList photoList=photosInterface.search(searchParams,500,1);
  
  if(photoList!=null){
  //Get search result and check the size of photo result
  for(int i=0;i&lt;photoList.size();i++){
  //get photo object
  Photo photo=(Photo)photoList.get(i);
  
  System.out.print(photo.getId()+"\t");
  out.write(photo.getId()+"\t");
  
  System.out.print(photo.getOwner().getId()+"\t");
  out.write(photo.getOwner().getId()+"\t");
  
  Photo photo1=photosInterface.getPhoto(photo.getId());
  
  
  if(photo1.getGeoData() != null ){
  System.out.print("latitute="+photo1.getGeoData().getLatitude()+"\t");
  out.write(photo1.getGeoData().getLatitude()+"\t");
  
  System.out.print("longitude="+photo1.getGeoData().getLongitude()+"\t");
  out.write(photo1.getGeoData().getLongitude()+"\t");
  }
  else {System.out.print(photo1.getGeoData()+"\t");
  out.write(photo1.getGeoData()+"\t\t"+photo1.getGeoData());}
  System.out.println("");
  out.write("\n");
  
  
  
  }
  out.close();
  }
  }}
  </code></pre>