public class SimpleFSDirectory extends FSDirectory
FSDirectory
using java.io.RandomAccessFile. However, this class has
poor concurrent performance (multiple threads will
bottleneck) as it synchronizes when multiple threads
read from the same file. It's usually better to use
NIOFSDirectory or MMapDirectory instead.| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleFSDirectory.SimpleFSIndexInput
Reads bytes with
RandomAccessFile.seek(long) followed by
RandomAccessFile.read(byte[], int, int). |
FSDirectory.FSIndexOutputDirectory.IndexInputSlicerDEFAULT_READ_CHUNK_SIZE, directory, staleFilesisOpen, lockFactory| Constructor and Description |
|---|
SimpleFSDirectory(File path)
Create a new SimpleFSDirectory for the named location and
NativeFSLockFactory. |
SimpleFSDirectory(File path,
LockFactory lockFactory)
Create a new SimpleFSDirectory for the named location.
|
| Modifier and Type | Method and Description |
|---|---|
Directory.IndexInputSlicer |
createSlicer(String name,
IOContext context)
Creates an
Directory.IndexInputSlicer for the given file name. |
IndexInput |
openInput(String name,
IOContext context)
Creates an IndexInput for the file with the given name.
|
close, createOutput, deleteFile, ensureCanWrite, fileExists, fileLength, fsync, getDirectory, getLockID, getReadChunkSize, listAll, listAll, onIndexOutputClosed, open, open, setLockFactory, setReadChunkSize, sync, toStringclearLock, ensureOpen, getLockFactory, makeLockcopy, openChecksumInputpublic SimpleFSDirectory(File path, LockFactory lockFactory) throws IOException
path - the path of the directorylockFactory - the lock factory to use, or null for the default
(NativeFSLockFactory);IOException - if there is a low-level I/O errorpublic SimpleFSDirectory(File path) throws IOException
NativeFSLockFactory.path - the path of the directoryIOException - if there is a low-level I/O errorpublic IndexInput openInput(String name, IOContext context) throws IOException
openInput in class DirectoryIOExceptionpublic Directory.IndexInputSlicer createSlicer(String name, IOContext context) throws IOException
DirectoryDirectory.IndexInputSlicer for the given file name.
IndexInputSlicer allows other Directory implementations to
efficiently open one or more sliced IndexInput instances from a
single file handle. The underlying file handle is kept open until the
Directory.IndexInputSlicer is closed.
Throws FileNotFoundException or NoSuchFileException
if the file does not exist.
createSlicer in class DirectoryIOException - if an IOException occursCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.