I need to run the mapreduce task, which is dynamic, in the sense that the parameters must be passed to the map and reduce the functions every time the mapreduce task is executed (for example, in response to a user request).
How to do it? I have not seen anywhere in the documentation how to perform dynamic processing at runtime for a map and reduce it.
class MatchProcessing(webapp2.RequestHandler): def get(self): requestKeyID=int(self.request.get('riderbeeRequestID')) userKey=self.request.get('userKey') pipeline = MatchingPipeline(requestKeyID, userKey) pipeline.start() self.redirect(pipeline.base_path + "/status?root=" + pipeline.pipeline_id) class MatchingPipeline(base_handler.PipelineBase): def run(self, requestKeyID, userKey): yield mapreduce_pipeline.MapreducePipeline( "riderbee_matching", "tasks.matchingMR.riderbee_map", "tasks.matchingMR.riderbee_reduce", "mapreduce.input_readers.DatastoreInputReader", "mapreduce.output_writers.BlobstoreOutputWriter", mapper_params={ "entity_kind": "models.rides.RiderbeeRequest", "requestKeyID": requestKeyID, "userKey": userKey, }, reducer_params={ "mime_type": "text/plain", }, shards=16) def riderbee_map(riderbeeRequest):
Help me please?
Johnny wong
source share