![]() |
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 | __repr__ |
def | MarkAsTransferred |
def | Process |
![]() | |
def | __init__ |
def | SetError |
def | PerformWork |
def | MarkAsRead |
def | MarkAsTransferring |
def | MarkAsTransferred |
def | MarkAsError |
![]() | |
def | __init__ |
def | PerformWork |
def | __str__ |
Public Attributes | |
request_manager | |
kind | |
key_range | |
download_result | |
count | |
key_start | |
key_end | |
first | |
![]() | |
progress_queue | |
state_namer | |
state | |
progress_key | |
progress_event | |
key_start | |
key_end | |
error | |
traceback | |
kind | |
Additional Inherited Members | |
![]() | |
string | SUCCESS = 'success' |
string | RETRY = 'retry' |
string | FAILURE = 'failure' |
Represents an item of work that scans over a key range. A KeyRangeItem object represents holds a KeyRange and has an associated state: STATE_READ, STATE_GETTING, STATE_GOT, and STATE_ERROR. - STATE_READ indicates the range ready to be downloaded by a worker thread. - STATE_GETTING indicates the range is currently being downloaded. - STATE_GOT indicates that the range was successfully downloaded - STATE_ERROR indicates that an error occurred during the last download attempt KeyRangeItems not in the STATE_GOT state are stored in the progress database. When a piece of KeyRangeItem work is downloaded, the download may cover only a portion of the range. In this case, the old KeyRangeItem is removed from the progress database and ranges covering the undownloaded range are generated and stored as STATE_READ in the export progress database.
def google.appengine.tools.bulkloader.KeyRangeItem.__init__ | ( | self, | |
request_manager, | |||
progress_queue, | |||
kind, | |||
key_range, | |||
progress_key = None , |
|||
state = STATE_READ , |
|||
first = False |
|||
) |
Initialize a KeyRangeItem object. Args: request_manager: A RequestManager instance. progress_queue: A queue used for tracking progress information. kind: The kind of entities for this range. key_range: A KeyRange instance for this work item. progress_key: The key for this range within the progress database. state: The initial state of this range. first: boolean, default False, whether this is the first WorkItem of its kind.
def google.appengine.tools.bulkloader.KeyRangeItem.MarkAsTransferred | ( | self | ) |
Mark this KeyRangeItem as transferred, updating the progress database.
def google.appengine.tools.bulkloader.KeyRangeItem.Process | ( | self, | |
download_result, | |||
thread_pool, | |||
batch_size, | |||
new_state = STATE_GOT |
|||
) |
Mark this KeyRangeItem as success, updating the progress database. Process will split this KeyRangeItem based on the content of download_result and adds the unfinished ranges to the work queue. Args: download_result: A DownloadResult instance. thread_pool: An AdaptiveThreadPool instance. batch_size: The number of entities to transfer per request. new_state: The state to transition the completed range to.