Commit ee8b1379 authored by Yong Tang's avatar Yong Tang Committed by Rohan Jain
Browse files

Improve SkipNBytes to RandomInputStream (#14557)



* Convert SkipNBytes in InputStreamInterface to pure virtual

This fix tries to address the issue raised in 14512 where SkipNBytes
will takes a long time as it needs to read through the file
even though it is possible to random access.

This fix convert SkipNBytes in InputStreamInterface to pure virtual
so that it is possible to have different implementations based
on the underlying file type (seekable vs. no seekable)

This fix fixes 14512.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add missing implementation in inputstream_interface_test.cc

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Update implementation of RandomInputStream

So that if random access read of 1 byte to the expected pos
is able to complete then return immediately. Otherwise,
read through until the pos is reached.

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Add SkipNBytes to SnappyInputBuffer

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Remove inputstream_interface.cc from makefile

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>

* Remove pure virtual and use override for RandomInputStream

Signed-off-by: default avatarYong Tang <yong.tang.github@outlook.com>
parent 76d621ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment