public class RAFDirectory 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.
NOTE: Because this uses RandomAccessFile, it will generally not work with non-default filesystem providers. It is only provided for applications that relied on the fact that RandomAccessFile's IO was not interruptible.
directory
isOpen, lockFactory
Constructor and Description |
---|
RAFDirectory(Path path)
Create a new SimpleFSDirectory for the named location and
FSLockFactory.getDefault() . |
RAFDirectory(Path path,
LockFactory lockFactory)
Create a new RAFDirectory for the named location.
|
Modifier and Type | Method and Description |
---|---|
IndexInput |
openInput(String name,
IOContext context)
Creates an IndexInput for the file with the given name.
|
close, createOutput, createTempOutput, deleteFile, deletePendingFiles, ensureCanRead, fileLength, fsync, getDirectory, getPendingDeletions, listAll, listAll, open, open, rename, sync, syncMetaData, toString
ensureOpen, obtainLock
copyFrom, getTempFileName, openChecksumInput
public RAFDirectory(Path path, LockFactory lockFactory) throws IOException
path
- the path of the directorylockFactory
- the lock factory to useIOException
- if there is a low-level I/O errorpublic RAFDirectory(Path path) throws IOException
FSLockFactory.getDefault()
.
The directory is created at the named location if it does not yet exist.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 Directory
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.