@app.route('/mapreduceasync', methods=['GET', 'POST'])
def MapReduceAsync():
  """Handler of MapReduce asynchronous request."""
  app.logger.info('ACCESS URL: %s', flask.request.path)

  try:
    os.mkdir(MAPREDUCE_RESULT_DIR)
  except __HOLE__:
    # The result directory already exists.  Do nothing.
    pass
  mapreduce_id = str(uuid.uuid4())

  threading.Thread(
      target=AsyncPerformMapReduce,
      args=(mapreduce_id,
            flask.request.values.get('input', ''),
            flask.request.values.get('output', ''),
            flask.request.values.get('mapper_type', 'identity'),
            flask.request.values.get('mapper_url', ''),
            flask.request.files.get('mapper_file', None),
            int(flask.request.values.get('mapper_count', 5)),
            flask.request.values.get('reducer_type', 'identity'),
            flask.request.values.get('reducer_url', ''),
            flask.request.files.get('reducer_file', None),
            int(flask.request.values.get('reducer_count', 1)))).start()

  return flask.Response(mapreduce_id, mimetype='text/plain')
dataset/ETHPy150Open GoogleCloudPlatform/Data-Pipeline/app/static/hadoop_scripts/rpc_daemon/__main__.py/MapReduceAsync