App Engine Python SDK  v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
Public Member Functions | Public Attributes | List of all members
google.appengine.ext.mapreduce.context.Context Class Reference
Inheritance diagram for google.appengine.ext.mapreduce.context.Context:

Public Member Functions

def __init__
 
def flush
 
def register_pool
 
def get_pool
 

Public Attributes

 mapreduce_spec
 
 task_retry_count
 
 mapreduce_id
 
 shard_id
 
 counters
 

Detailed Description

MapReduce execution context.

The main purpose of Context is to facilitate IO. User code, input reader,
and output writer code can plug in pools (see Pool class) to Context to
batch operations.

There is a single Context instance associated with each worker thread.
It can be accessed via context.get(). handlers.MapperWorkerHandler creates
this instance before any IO code (input_reader, output_writer, user functions)
is called.

Each Pool decides how to batch and when to flush.
Context and all its pools are flushed by the end of a slice.
Upon error in slice execution, what is flushed is undefined. (See _Counters
for an exception).

Properties:
  mapreduce_spec: current mapreduce specification as model.MapreduceSpec.

Constructor & Destructor Documentation

def google.appengine.ext.mapreduce.context.Context.__init__ (   self,
  mapreduce_spec,
  shard_state,
  task_retry_count = 0 
)
Constructor.

Args:
  mapreduce_spec: mapreduce specification as model.MapreduceSpec.
  shard_state: an instance of model.ShardState. This has to be the same
instance as the one MapperWorkerHandler mutates. All mutations are
flushed to datastore in the end of the slice.
  task_retry_count: how many times this task has been retried.

Member Function Documentation

def google.appengine.ext.mapreduce.context.Context.flush (   self)
Flush all information recorded in context.
def google.appengine.ext.mapreduce.context.Context.get_pool (   self,
  key 
)
Obtains an instance of registered pool.

Args:
  key: pool key as string.

Returns:
  an instance of the pool registered earlier, or None.
def google.appengine.ext.mapreduce.context.Context.register_pool (   self,
  key,
  pool 
)
Register an arbitrary pool to be flushed together with this context.

Args:
  key: pool key as string.
  pool: a pool instance.

The documentation for this class was generated from the following file: