beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [beam] branch master updated: [BEAM-6380] Add some debugging output.
Date Fri, 15 Feb 2019 16:17:58 GMT
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 <ehudm@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:


Mime
View raw message