You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by cc...@apache.org on 2019/02/15 16:17:58 UTC
[beam] branch master updated: [BEAM-6380] Add some debugging output.
This is an automated email from the ASF dual-hosted git repository.
ccy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new 47a0f35 [BEAM-6380] Add some debugging output.
new 8cb181d Merge pull request #7837 from udim/beam-6380
47a0f35 is described below
commit 47a0f3537306ee9bbfe9c854df7cd72787f36eec
Author: Udi Meiri <eh...@google.com>
AuthorDate: Wed Feb 13 15:46:25 2019 -0800
[BEAM-6380] Add some debugging output.
---
sdks/python/apache_beam/io/filesystemio.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/sdks/python/apache_beam/io/filesystemio.py b/sdks/python/apache_beam/io/filesystemio.py
index 9c90b78..dca341d 100644
--- a/sdks/python/apache_beam/io/filesystemio.py
+++ b/sdks/python/apache_beam/io/filesystemio.py
@@ -213,6 +213,8 @@ class PipeStream(object):
def __init__(self, recv_pipe):
self.conn = recv_pipe
self.closed = False
+ # TODO(BEAM-6380): For debugging.
+ self.last_position = None
self.position = 0
self.remaining = b''
@@ -232,6 +234,7 @@ class PipeStream(object):
bytes_from_remaining = min(size - bytes_read, len(self.remaining))
data_list.append(self.remaining[0:bytes_from_remaining])
self.remaining = self.remaining[bytes_from_remaining:]
+ self.last_position = self.position
self.position += bytes_from_remaining
bytes_read += bytes_from_remaining
if not self.remaining:
@@ -261,7 +264,9 @@ class PipeStream(object):
return
elif whence == os.SEEK_SET and offset == self.position:
return
- raise NotImplementedError
+ raise NotImplementedError(
+ 'offset: %s, whence: %s, position: %s, last: %s' % (
+ offset, whence, self.position, self.last_position))
def _check_open(self):
if self.closed: