[
https://issues.apache.org/jira/browse/BEAM-4062?focusedWorklogId=92784&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-92784
]
ASF GitHub Bot logged work on BEAM-4062:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Apr/18 18:46
Start Date: 19/Apr/18 18:46
Worklog Time Spent: 10m
Work Description: udim commented on a change in pull request #5158:
[BEAM-4062] Fix performance regression in FileBasedSink.
URL: https://github.com/apache/beam/pull/5158#discussion_r182844110
##########
File path: sdks/python/apache_beam/io/filebasedsink.py
##########
@@ -299,6 +323,14 @@ def _rename_batch(batch):
# May have already been removed.
pass
+ @staticmethod
+ def _template_replace_num_shards(shard_name_template):
+ m = re.search('N+', shard_name_template)
+ if m:
+ shard_name_template = shard_name_template.replace(
+ m.group(0), '%%(num_shards)0%dd' % len(m.group(0)))
Review comment:
I don't understand this comment.
This code is replacing a substring that looks like `NNN` with
`%(num_shards)03d`.
`num_shards` appears in a string in the second parameter to `replace()`.
Where should it be instead?
----------------------------------------------------------------
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: 92784)
> Performance regression in FileBasedSink
> ---------------------------------------
>
> Key: BEAM-4062
> URL: https://issues.apache.org/jira/browse/BEAM-4062
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core
> Reporter: Udi Meiri
> Assignee: Udi Meiri
> Priority: Blocker
> Fix For: 2.5.0
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> [https://github.com/apache/beam/pull/4648] has added:
> * 3 or more stat() calls per output file (in pre_finalize and
> finalize_writes)
> * serial unbatched delete()s (in pre_finalize)
> Solution will be to list files in a batch operation (match()), and to
> delete() in batch mode, or use multiple threads if that's not possible.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)