Clean more ConsumerCoordinator docstrings
This commit is contained in:
@@ -272,13 +272,16 @@ class ConsumerCoordinator(AbstractCoordinator):
|
|||||||
super(ConsumerCoordinator, self).close()
|
super(ConsumerCoordinator, self).close()
|
||||||
|
|
||||||
def commit_offsets_async(self, offsets, callback=None):
|
def commit_offsets_async(self, offsets, callback=None):
|
||||||
"""
|
"""Commit specific offsets asynchronously.
|
||||||
@param offsets: dict of {TopicPartition: OffsetAndMetadata} to commit
|
|
||||||
@param callback: called as callback(offsets, response), with response
|
Arguments:
|
||||||
as either an Exception or a OffsetCommitResponse
|
offsets (dict {TopicPartition: OffsetAndMetadata}): what to commit
|
||||||
struct. This callback can be used to trigger custom
|
callback (callable, optional): called as callback(offsets, response)
|
||||||
actions when a commit request completes.
|
response will be either an Exception or a OffsetCommitResponse
|
||||||
@returns Future
|
struct. This callback can be used to trigger custom actions when
|
||||||
|
a commit request completes.
|
||||||
|
Returns:
|
||||||
|
Future: indicating whether the commit was successful or not
|
||||||
"""
|
"""
|
||||||
self._subscription.needs_fetch_committed_offsets = True
|
self._subscription.needs_fetch_committed_offsets = True
|
||||||
future = self._send_offset_commit_request(offsets)
|
future = self._send_offset_commit_request(offsets)
|
||||||
@@ -286,15 +289,15 @@ class ConsumerCoordinator(AbstractCoordinator):
|
|||||||
future.add_both(cb, offsets)
|
future.add_both(cb, offsets)
|
||||||
|
|
||||||
def commit_offsets_sync(self, offsets):
|
def commit_offsets_sync(self, offsets):
|
||||||
"""
|
"""Commit specific offsets synchronously.
|
||||||
Commit offsets synchronously. This method will retry until the commit
|
|
||||||
completes successfully or an unrecoverable error is encountered.
|
|
||||||
|
|
||||||
@param offsets dict of {TopicPartition: OffsetAndMetadata} to commit
|
This method will retry until the commit completes successfully or an
|
||||||
@raises TopicAuthorizationError if the consumer is not authorized to the
|
unrecoverable error is encountered.
|
||||||
group or to any of the specified partitions
|
|
||||||
@raises CommitFailedError if an unrecoverable error occurs before the
|
Arguments:
|
||||||
commit can be completed
|
offsets (dict {TopicPartition: OffsetAndMetadata}): what to commit
|
||||||
|
|
||||||
|
Raises error on failure
|
||||||
"""
|
"""
|
||||||
if not offsets:
|
if not offsets:
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user