#NEWLINE# def commit( self , offsets = None ) : #NEWLINE# #INDENT# 'Commit offsets to kafka, blocking until success or error\n\n        This commits offsets only to Kafka. The offsets committed using this API\n        will be used on the first fetch after every rebalance and also on\n        startup. As such, if you need to store offsets in anything other than\n        Kafka, this API should not be used. To avoid re-processing the last\n        message read if a consumer is restarted, the committed offset should be\n        the next message your application should consume, i.e.: last_offset + 1.\n\n        Blocks until either the commit succeeds or an unrecoverable error is\n        encountered (in which case it is thrown to the caller).\n\n        Currently only supports kafka-topic offset storage (not zookeeper)\n\n        Arguments:\n            offsets (dict, optional): {TopicPartition: OffsetAndMetadata} dict\n                to commit with the configured group_id. Defaults to current\n                consumed offsets for all subscribed partitions.\n        ' #NEWLINE# assert ( offsets . config [ 'api_version' ] >= ( 0 , 8 , 1 ) ) , 'Requires >= Kafka 0.8.1' #NEWLINE# assert ( self . config [ 'group_id' ] is not None ) , 'Requires group_id' #NEWLINE# if ( offsets is None ) : #NEWLINE# #INDENT# offsets = self . _subscription . all_consumed_offsets ( ) #NEWLINE# #UNINDENT# self . _coordinator . commit_offsets_sync ( offsets )