![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | __str__ |
def | append |
def | flush |
def | clear |
def | should_flush |
Public Attributes | |
items | |
Static Public Attributes | |
int | DEFAULT_RETRIES = 3 |
A buffer that holds arbitrary items and auto flushes them when full. Callers of this class provides the logic on how to flush. This class takes care of the common logic of when to flush and when to retry. Properties: items: list of objects. length: length of item list. size: aggregate item size in bytes.
def google.appengine.ext.mapreduce.context._ItemList.__init__ | ( | self, | |
max_entity_count, | |||
flush_function, | |||
timeout_retries = DEFAULT_RETRIES , |
|||
repr_function = None |
|||
) |
Constructor. Args: max_entity_count: maximum number of entities before flushing it to db. flush_function: a function that can flush the items. The function is called with a list of items as the first argument, a dict of options as second argument. Currently options can contain {"deadline": int}. see self.flush on how the function is called. timeout_retries: how many times to retry upon timeouts. repr_function: a function that turns an item into meaningful representation. For debugging large items.
def google.appengine.ext.mapreduce.context._ItemList.append | ( | self, | |
item | |||
) |
Add new item to the list. If needed, append will first flush existing items and clear existing items. Args: item: an item to add to the list.
def google.appengine.ext.mapreduce.context._ItemList.clear | ( | self | ) |
Clear item list.
def google.appengine.ext.mapreduce.context._ItemList.flush | ( | self | ) |
Force a flush.
def google.appengine.ext.mapreduce.context._ItemList.should_flush | ( | self | ) |
Whether to flush before append the next entity. Returns: True to flush. False other.