voldemort.store.readonly.io
Class MappedFileReader
java.lang.Object
voldemort.store.readonly.io.BaseMappedFile
voldemort.store.readonly.io.MappedFileReader
- All Implemented Interfaces:
- java.io.Closeable
public class MappedFileReader
- extends BaseMappedFile
- implements java.io.Closeable
Facade around a MappedByteBuffer but we also support mlock on the mapped
pages, and closing all dependent resources.
Field Summary |
protected java.io.FileInputStream |
in
|
protected java.nio.MappedByteBuffer |
mappedByteBuffer
|
Method Summary |
void |
close()
|
java.nio.MappedByteBuffer |
map(boolean setAutoLock)
Read from this mapped file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
in
protected java.io.FileInputStream in
mappedByteBuffer
protected java.nio.MappedByteBuffer mappedByteBuffer
MappedFileReader
public MappedFileReader(java.lang.String path)
throws java.io.IOException
- Throws:
java.io.IOException
MappedFileReader
public MappedFileReader(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
map
public java.nio.MappedByteBuffer map(boolean setAutoLock)
throws java.io.IOException
- Read from this mapped file.
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Specified by:
close
in interface java.io.Closeable
- Throws:
java.io.IOException
Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu