Author: Emmett Butler

pykafka.utils.error_handlers.handle_partition_responses(error_handlers, parts_by_error=None, success_handler=None, response=None, partitions_by_id=None)

Call the appropriate handler for each errored partition

  • error_handlers (dict {int: callable(parts)}) – mapping of error code to handler
  • parts_by_error (dict {int: iterable(pykafka.simpleconsumer.OwnedPartition)}) – a dict of partitions grouped by error code
  • success_handler (callable accepting an iterable of partition responses) – function to call for successful partitions
  • response (pykafka.protocol.Response) – a Response object containing partition responses
  • partitions_by_id (dict {int: pykafka.simpleconsumer.OwnedPartition}) – a dict mapping partition ids to OwnedPartition instances
pykafka.utils.error_handlers.raise_error(error, info='')

Raise the given error