-
Notifications
You must be signed in to change notification settings - Fork 7k
[data] Clear queue for manually mark_execution_finished operators #58441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7b782c4
51a5778
c4f9ec3
1963483
56dcbaf
48c0485
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -65,7 +65,7 @@ | |
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| class MapOperator(OneToOneOperator, InternalQueueOperatorMixin, ABC): | ||
| class MapOperator(InternalQueueOperatorMixin, OneToOneOperator, ABC): | ||
| """A streaming operator that maps input bundles 1:1 to output bundles. | ||
|
|
||
| This operator implements the distributed map operation, supporting both task | ||
|
|
@@ -108,7 +108,7 @@ def __init__( | |
| self._block_ref_bundler = _BlockRefBundler(min_rows_per_bundle) | ||
|
|
||
| # Queue for task outputs, either ordered or unordered (this is set by start()). | ||
| self._output_queue: _OutputQueue = None | ||
| self._output_queue: Optional[_OutputQueue] = None | ||
| # Output metadata, added to on get_next(). | ||
| self._output_blocks_stats: List[BlockStats] = [] | ||
| # All active `DataOpTask`s. | ||
|
|
@@ -165,6 +165,19 @@ def internal_output_queue_num_blocks(self) -> int: | |
| def internal_output_queue_num_bytes(self) -> int: | ||
| return self._output_queue.size_bytes() | ||
|
|
||
| def clear_internal_input_queue(self) -> None: | ||
| """Clear internal input queue (block ref bundler).""" | ||
| while self._block_ref_bundler.has_bundle(): | ||
| (input_bundles, _) = self._block_ref_bundler.get_next_bundle() | ||
| for input_bundle in input_bundles: | ||
| self._metrics.on_input_dequeued(input_bundle) | ||
|
|
||
| def clear_internal_output_queue(self) -> None: | ||
| """Clear internal output queue.""" | ||
| while self._output_queue.has_next(): | ||
| bundle = self._output_queue.get_next() | ||
| self._metrics.on_output_dequeued(bundle) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Output queue accessed before initialization.The
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can't happen because we always call start() on an operator. |
||
|
|
||
| @property | ||
| def name(self) -> str: | ||
| name = super().name | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.