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.Directory.IndexInputSlicerDEFAULT_READ_CHUNK_SIZE| Constructor and Description |
|---|
SimpleFSDirectory(java.io.File path)
Create a new SimpleFSDirectory for the named location and
NativeFSLockFactory. |
SimpleFSDirectory(java.io.File path,
LockFactory lockFactory)
Create a new SimpleFSDirectory for the named location.
|
| Modifier and Type | Method and Description |
|---|---|
Directory.IndexInputSlicer |
createSlicer(java.lang.String name,
IOContext context)
Creates an
Directory.IndexInputSlicer for the given file name. |
IndexInput |
openInput(java.lang.String name,
IOContext context)
Creates an IndexInput for the file with the given name.
|
close, createOutput, deleteFile, fileExists, fileLength, getDirectory, getLockID, getReadChunkSize, listAll, listAll, open, open, setLockFactory, setReadChunkSize, sync, toStringclearLock, getLockFactory, makeLockpublic SimpleFSDirectory(java.io.File path,
LockFactory lockFactory)
throws java.io.IOException
path - the path of the directorylockFactory - the lock factory to use, or null for the default
(NativeFSLockFactory);java.io.IOException - if there is a low-level I/O errorpublic SimpleFSDirectory(java.io.File path)
throws java.io.IOException
NativeFSLockFactory.path - the path of the directoryjava.io.IOException - if there is a low-level I/O errorpublic IndexInput openInput(java.lang.String name, IOContext context) throws java.io.IOException
public Directory.IndexInputSlicer createSlicer(java.lang.String name, IOContext context) throws java.io.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.
FileNotFoundException if the file does not exist
(not java.nio.file.NoSuchFileException of Java 7).createSlicer in class Directoryjava.io.IOException - if an IOException occursCopyright © 2010 - 2024 Adobe. All Rights Reserved