public class NIOFSDirectory extends FSDirectory
FSDirectoryimplementation that uses java.nio's FileChannel's positional read, which allows multiple threads to read from the same file without synchronizing.
This class only uses FileChannel when reading; writing is achieved with
NOTE: NIOFSDirectory is not recommended on Windows because of a bug in how FileChannel.read is implemented in Sun's JRE. Inside of the implementation the position is apparently synchronized. See here for details.
NOTE: Accessing this class either directly or
indirectly from a thread while it's interrupted can close the
underlying file descriptor immediately if at the same time the thread is
blocked on IO. The file descriptor will remain closed and subsequent access
NIOFSDirectory will throw a
your application uses either
Future.cancel(boolean) you should use
|Modifier and Type||Class and Description|
DEFAULT_READ_CHUNK_SIZE, directory, staleFiles
|Constructor and Description|
Create a new NIOFSDirectory for the named location and
Create a new NIOFSDirectory for the named location.
|Modifier and Type||Method and Description|
Creates an IndexInput for the file with the given name.
close, createOutput, deleteFile, ensureCanWrite, fileExists, fileLength, fileModified, fileModified, fsync, getDirectory, getFile, getLockID, getReadChunkSize, listAll, listAll, onIndexOutputClosed, open, open, openInput, setLockFactory, setReadChunkSize, sync, sync, toString, touchFile
clearLock, copy, copy, ensureOpen, getLockFactory, makeLock
public NIOFSDirectory(File path, LockFactory lockFactory) throws IOException