Commits


Yuan Zhou authored and Antoine Pitrou committed 1c42e6f1b0e
ARROW-6141: [C++] Enable memory-mapping a file region This patch adds an Open() method for MemoryMappedFile() with length and offset params. In this way user can memory map a file region just like mmap(). The new API is: * MemoryMappedFile::Open(path, mode, length, offset, &mmap) The original API is still available. Calling the original API will memory map the whole file: * MemoryMappedFile::Open(path, mode, &mmap) A new field map_len_ is added in MemoryMappedFile::MemoryMap to track the real memory map length. Also MemoryMappedFile::Read()/ReadAt()/Write()/WriteAt() are changed to check the memory map length if it's a region based memory map. Note the MemoryMappedFile::Resize() is not supported if it's a region based memory map. Signed-off-by: Yuan Zhou <yuan.zhou@intel.com> Closes #5101 from zhouyuan/wip_6141 and squashes the following commits: 030994bcc <Yuan Zhou> ARROW-6141: Enable memory-mapping a file region Authored-by: Yuan Zhou <yuan.zhou@intel.com> Signed-off-by: Antoine Pitrou <antoine@python.org>