diff options
author | Dana Powers <dana.powers@rd.io> | 2015-12-29 17:01:41 -0800 |
---|---|---|
committer | Dana Powers <dana.powers@rd.io> | 2015-12-29 17:05:08 -0800 |
commit | 2a2733d4fc725f04461a6c4d0ca0fc253f99caeb (patch) | |
tree | 440c6e4816a91b5290aabb36d3570e9daab5db43 /kafka/coordinator/abstract.py | |
parent | b7d1ed3fb4644c3b255eea356b7de273b522d1f4 (diff) | |
download | kafka-python-2a2733d4fc725f04461a6c4d0ca0fc253f99caeb.tar.gz |
Improve various docstrings
Diffstat (limited to 'kafka/coordinator/abstract.py')
-rw-r--r-- | kafka/coordinator/abstract.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/kafka/coordinator/abstract.py b/kafka/coordinator/abstract.py index 2dc8269..b0413d5 100644 --- a/kafka/coordinator/abstract.py +++ b/kafka/coordinator/abstract.py @@ -230,7 +230,9 @@ class AbstractCoordinator(object): This function handles both JoinGroup and SyncGroup, delegating to _perform_assignment() if elected leader by the coordinator. - @return Future() of the assignment returned from the group leader + Returns: + Future: resolves to the encoded-bytes assignment returned from the + group leader """ if self.coordinator_unknown(): e = Errors.GroupCoordinatorNotAvailableError(self.coordinator_id) @@ -323,6 +325,12 @@ class AbstractCoordinator(object): """ Perform leader synchronization and send back the assignment for the group via SyncGroupRequest + + Arguments: + response (JoinResponse): broker response to parse + + Returns: + Future: resolves to member assignment encoded-bytes """ try: group_assignment = self._perform_assignment(response.leader_id, @@ -391,10 +399,8 @@ class AbstractCoordinator(object): def _send_group_metadata_request(self): """Discover the current coordinator for the group. - Sends a GroupMetadata request to one of the brokers. The returned future - should be polled to get the result of the request. - - @return future indicating the completion of the metadata request + Returns: + Future: resolves to the node id of the coordinator """ node_id = self._client.least_loaded_node() if node_id is None or not self._client.ready(node_id): @@ -477,7 +483,7 @@ class AbstractCoordinator(object): log.error("LeaveGroup request failed: %s", error_type()) def _send_heartbeat_request(self): - """Send a heartbeat request now (visible only for testing).""" + """Send a heartbeat request""" request = HeartbeatRequest(self.group_id, self.generation, self.member_id) future = Future() _f = self._client.send(self.coordinator_id, request) |