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

  try:
    os.mkdir(MAPREDUCE_RESULT_DIR)
  except OSError:
    # 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')
Handler of MapReduce asynchronous request.
dataset/ETHPy150Open GoogleCloudPlatform/Data-Pipeline/app/static/hadoop_scripts/rpc_daemon/__main__.py/MapReduceAsync