Database Reference
In-Depth Information
max_instances: 1
handlers:
- url: /mapreduce/pipeline/images
static_dir: mapreduce/lib/pipeline/ui/images
- url: /mapreduce(/.*)?
script: mapreduce.main.APP
login: admin
- url: .*
script: controller.app
login: admin
libraries:
- name: webapp2
version: latest
- name: pycrypto
version: latest
The common bits have been elided to highlight the portions that enable
implementation of the controller script, which is defined in
controller.py . Most of the controller script defines a simple web
application that allows the process to be started by an HTTP POST request
and then displays the status of individual steps in the process. A single
function, run_transform , and a couple of helper functions handle the
transformation process. Listing 12.8 contains the definition of the
MapReduce job.
Listing 12.8 : The RunTransform task (appengine/controller.py)
import cgi
import time
import threading
import json
from google.appengine.api import users
from google.appengine.ext.webapp.util import
 
 
Search WWH ::




Custom Search