[
https://issues.apache.org/jira/browse/BEAM-6655?focusedWorklogId=203282&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-203282
]
ASF GitHub Bot logged work on BEAM-6655:
----------------------------------------
Author: ASF GitHub Bot
Created on: 24/Feb/19 19:00
Start Date: 24/Feb/19 19:00
Worklog Time Spent: 10m
Work Description: chamikaramj commented on pull request #7819:
[BEAM-6655] Initial support for progress reporting over the FnAPI.
URL: https://github.com/apache/beam/pull/7819#discussion_r259599237
##########
File path: sdks/python/apache_beam/io/iobase.py
##########
@@ -1165,3 +1171,56 @@ def check_done(self):
~exceptions.ValueError: if there is still any unclaimed work remaining.
"""
raise NotImplementedError
+
+
+class RestrictionProgress(object):
+ """Used to record the progress of a restriction.
+
+ Experimental; no backwards-compatibility guarantees.
+ """
+ def __init__(self, **kwargs):
+ # Only accept keyword arguments.
+ self._fraction = kwargs.pop('fraction', None)
+ self._completed = kwargs.pop('completed', None)
+ self._remaining = kwargs.pop('remaining', None)
+ assert not kwargs
+
+ def __repr__(self):
+ return 'RestrictionProgress(fraction=%s, completed=%s, remaining=%s)' % (
+ self._fraction, self._completed, self._remaining)
+
+ @property
+ def completed(self):
+ if self._completed:
+ return self._completed
+ elif self._remaining and self._fraction:
+ return self._remaining * self._fraction / (1 - self._fraction)
Review comment:
Will we ever run into a case where we know remaining but not completed in
practice ?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 203282)
Time Spent: 1h 10m (was: 1h)
> Support progress reporting over FnAPI
> -------------------------------------
>
> Key: BEAM-6655
> URL: https://issues.apache.org/jira/browse/BEAM-6655
> Project: Beam
> Issue Type: New Feature
> Components: beam-model, sdk-java-harness, sdk-py-harness
> Reporter: Robert Bradshaw
> Priority: Major
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)