Comp150CPA: Clouds and Power-Aware Computing
Midterm Examination.
April 6, 2011 -- Open Notes

Name: ______________________________________________

Login: ______________

Please answer the following questions on these sheets. Please put your name at the top of each sheet. You may use any printed material. Electronic devices are prohibited.

  1. (20 points) Can an object marked as @Persistent in AppEngine contain an instance of another @Persistent object as a member? Why or why not?
  2. (30 points) Suppose you have an input that has entries like the following:
     
    time person activity 
    
    where Please write a Pig script that computes the total time that George spent sleeping. This is the sum of the differences between times that George started sleeping and times that George started doing something else. For example, for the data
     
    10001  George sleeping
    10006  George walking
    10100  George sleeping
    10200  George showering
    10500  George running
    
    your program should output the number 105, which is 10006 - 10001 + 10200 - 10100. You may assume that every time George starts sleeping, there is another subsequent event when George stops sleeping.

    Name: ______________________________________________

    Login: ______________

  3. (25 points) List the disadvantages of structuring a program via service-oriented architecture (SOA). Then explain why these disadvantages are less important than the business needs that are satisfied through SOA.
  4. (25 points) You are designing a stock-market analysis tool that takes as input events of the form:
    time stock change
    
    where: You wish to analyze these in a variety of ways, looking for subtle correlations.
    1. (10 points) Should you use a datastore with strong or eventual consistency? Why?
    2. (15 points) Should you use a Map/Reduce or Distributed-Hash-Table infrastructure to store the data? Why?