Package arvados :: Module arvfile :: Class ArvadosFileReader
[hide private]
[frames] | no frames]

Class ArvadosFileReader

source code

builtins.object --+        
                  |        
_FileLikeObjectBase --+    
                      |    
  ArvadosFileReaderBase --+
                          |
                         ArvadosFileReader

Wraps ArvadosFile in a file-like object supporting reading only.

Be aware that this class is NOT thread safe as there is no locking around updating file pointer.

Instance Methods [hide private]
 
__init__(self, arvadosfile, mode="r", num_retries=None) source code
 
size(self) source code
 
stream_name(self) source code
 
readinto(self, b) source code
 
read(self, size=None, num_retries=None)
Read up to `size` bytes from the file and return the result.
source code
 
readfrom(self, offset, size, num_retries=None)
Read up to `size` bytes from the stream, starting at the specified file offset.
source code
 
flush(self) source code

Inherited from ArvadosFileReaderBase: __iter__, decompress, decompressed_name, readable, readall, readall_decompressed, readline, readlines, seek, seekable, tell, writable

Inherited from _FileLikeObjectBase: __enter__, __exit__, close

Static Methods [hide private]

Inherited from _FileLikeObjectBase (private): _before_close

Method Details [hide private]

__init__(self, arvadosfile, mode="r", num_retries=None)
(Constructor)

source code 
Overrides: _FileLikeObjectBase.__init__

size(self)

source code 
Overrides: ArvadosFileReaderBase.size

read(self, size=None, num_retries=None)

source code 

Read up to `size` bytes from the file and return the result.

Starts at the current file position. If `size` is None, read the entire remainder of the file.

Decorators:
  • @_FileLikeObjectBase._before_close
  • @retry_method
Overrides: ArvadosFileReaderBase.read

readfrom(self, offset, size, num_retries=None)

source code 

Read up to `size` bytes from the stream, starting at the specified file offset.

This method does not change the file position.

Decorators:
  • @_FileLikeObjectBase._before_close
  • @retry_method
Overrides: ArvadosFileReaderBase.readfrom