 
   fb.on("child_added", newMessage = (snapshot) ->
     message = snapshot.val()
-    console.log message
     switch message.name
       when "START_JOB" then (
         if (not (currentJobs[message.job] == -1))

  finishReducer: (reducerid) ->
    @reducers[reducerid].finished = true
    @numReducers++
    if (@numReducers == @totalReducers)
      jobMap = @combineToJobMap()
      str = @serializeJobMap(jobMap)
      @saveToFile(str)
      firebase_db.JOB_STATUS_REF.child(@job).child('output_url')
      .set(constants.OUTPUT_DIR + @job)

  combineToJobMap: () ->
    jobMap = {}

    fs.writeFileSync(constants.TOP_DIR + constants.OUTPUT_DIR + @job, str)

test = (fb) ->
  fb.push({name: "START_JOB", job: 7, numReducers: 3})
  fb.push({name: "START_REDUCER_OUTPUT", job: 7, reducer: 3})
  fb.push({name: "STOP_REDUCER_OUTPUT", job: 7, reducer: 3})
  fb.push({name: "START_REDUCER_OUTPUT", job: 7, reducer: 1})
  fb.push({
    name: "REDUCER_OUTPUT",
