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

Public Member Functions

def __init__
 
def __iter__
 
def __str__
 
def validate
 
def split_input
 
def to_json
 
def from_json
 
- Public Member Functions inherited from google.appengine.ext.mapreduce.input_readers.InputReader
def __iter__
 
def next
 
def from_json
 
def to_json
 
def split_input
 
def validate
 
- Public Member Functions inherited from google.appengine.ext.mapreduce.json_util.JsonMixin
def to_json_str
 
def from_json_str
 

Static Public Attributes

int MAX_NAMESPACES_FOR_KEY_SHARD = 10
 
string ENTITY_KIND_PARAM = "entity_kind"
 
string KEYS_ONLY_PARAM = "keys_only"
 
string BATCH_SIZE_PARAM = "batch_size"
 
string KEY_RANGE_PARAM = "key_range"
 
string NAMESPACE_RANGE_PARAM = "namespace_range"
 
string CURRENT_KEY_RANGE_PARAM = "current_key_range"
 
string FILTERS_PARAM = "filters"
 
- Static Public Attributes inherited from google.appengine.ext.mapreduce.input_readers.InputReader
 expand_parameters = False
 
string NAMESPACE_PARAM = "namespace"
 
string NAMESPACES_PARAM = "namespaces"
 

Detailed Description

Abstract base class for classes that iterate over datastore entities.

Concrete subclasses must implement _iter_key_range(self, k_range). See the
docstring for that method for details.

Constructor & Destructor Documentation

def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.__init__ (   self,
  entity_kind,
  key_ranges = None,
  ns_range = None,
  batch_size = _BATCH_SIZE,
  current_key_range = None,
  filters = None 
)
Create new AbstractDatastoreInputReader object.

This is internal constructor. Use split_query in a concrete class instead.

Args:
  entity_kind: entity kind as string.
  key_ranges: a sequence of key_range.KeyRange instances to process. Only
  one of key_ranges or ns_range can be non-None.
  ns_range: a namespace_range.NamespaceRange to process. Only one of
  key_ranges or ns_range can be non-None.
  batch_size: size of read batch as int.
  current_key_range: the current key_range.KeyRange being processed.
  filters: optional list of filters to apply to the query. Each filter is
a tuple: (<property_name_as_str>, <query_operation_as_str>, <value>).
User filters are applied first.

Member Function Documentation

def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.__iter__ (   self)
Iterates over the given KeyRanges or NamespaceRange.

This method iterates over the given KeyRanges or NamespaceRange and sets
the self._current_key_range to the KeyRange currently being processed. It
then delegates to the _iter_key_range method to yield that actual
results.

Yields:
  Forwards the objects yielded by the subclasses concrete _iter_key_range()
  method. The caller must consume the result yielded because self.to_json()
  will not include it.
def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.__str__ (   self)
Returns the string representation of this InputReader.
def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.from_json (   cls,
  json 
)
Create new DatastoreInputReader from the json, encoded by to_json.

Args:
  json: json map representation of DatastoreInputReader.

Returns:
  an instance of DatastoreInputReader with all data deserialized from json.
def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.split_input (   cls,
  mapper_spec 
)
Splits query into shards without fetching query results.

Tries as best as it can to split the whole query result set into equal
shards. Due to difficulty of making the perfect split, resulting shards'
sizes might differ significantly from each other.

Args:
  mapper_spec: MapperSpec with params containing 'entity_kind'.
May have 'namespace' in the params as a string containing a single
namespace. If specified then the input reader will only yield values
in the given namespace. If 'namespace' is not given then values from
all namespaces will be yielded. May also have 'batch_size' in the params
to specify the number of entities to process in each batch.

Returns:
  A list of InputReader objects. If the query results are empty then the
  empty list will be returned. Otherwise, the list will always have a length
  equal to number_of_shards but may be padded with Nones if there are too
  few results for effective sharding.
def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.to_json (   self)
Serializes all the data in this query range into json form.

Returns:
  all the data in json-compatible map.
def google.appengine.ext.mapreduce.input_readers._OldAbstractDatastoreInputReader.validate (   cls,
  mapper_spec 
)
Validates mapper spec and all mapper parameters.

Args:
  mapper_spec: The MapperSpec for this InputReader.

Raises:
  BadReaderParamsError: required parameters are missing or invalid.

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