diff options
| author | Dana Powers <dana.powers@gmail.com> | 2016-01-31 23:46:31 -0800 |
|---|---|---|
| committer | Dana Powers <dana.powers@gmail.com> | 2016-01-31 23:46:31 -0800 |
| commit | 843b34732d3cc5593c9e03c5ea062d705086eb8c (patch) | |
| tree | 6a34b0491f5fe69753c9adb2fdde5661365af13f /kafka/consumer/fetcher.py | |
| parent | 33b9ff2e339db34684ba0189e1f4e5865bc4ed9f (diff) | |
| download | kafka-python-843b34732d3cc5593c9e03c5ea062d705086eb8c.tar.gz | |
Add KafkaConsumer.highwater(partition) to get highwater offsets from FetchResponses
Diffstat (limited to 'kafka/consumer/fetcher.py')
| -rw-r--r-- | kafka/consumer/fetcher.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kafka/consumer/fetcher.py b/kafka/consumer/fetcher.py index 41f53aa..5cc1f9d 100644 --- a/kafka/consumer/fetcher.py +++ b/kafka/consumer/fetcher.py @@ -574,11 +574,13 @@ class Fetcher(six.Iterator): # consumption paused while fetch is still in-flight log.debug("Ignoring fetched records for partition %s" " since it is no longer fetchable", tp) + elif error_type is Errors.NoError: - fetch_offset = fetch_offsets[tp] + self._subscriptions.assignment[tp].highwater = highwater # we are interested in this fetch only if the beginning # offset matches the current consumed position + fetch_offset = fetch_offsets[tp] position = self._subscriptions.assignment[tp].position if position is None or position != fetch_offset: log.debug("Discarding fetch response for partition %s" |
