'Constructor.
Args:
export_recorder: Object which writes results, an implementation of
ConnectorInterface.
entity_to_dict: Method which converts a single entity to a neutral dict.
kind: Kind to identify this object to the bulkloader.
sort_key_from_entity: Optional method to return a sort key for each
entity. This key will be used to sort the downloaded entities before
passing them to eneity_to_dict.'

def __init__(self, export_recorder, entity_to_dict, kind, sort_key_from_entity):

    self.export_recorder = export_recorder
    self.entity_to_dict = entity_to_dict
    self.kind = kind
    self.sort_key_from_entity = sort_key_from_entity
    self.calculate_sort_key_from_entity = bool(sort_key_from_entity)
    self.bulkload_state = BulkloadState()
