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 |
protected static class |
SimpleFSDirectory.SimpleFSIndexOutput |
FSDirectory.FSIndexInput, FSDirectory.FSIndexOutput
DEFAULT_READ_CHUNK_SIZE, directory, LOCK_DIR
isOpen, lockFactory
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 |
---|---|
IndexOutput |
createOutput(java.lang.String name)
Creates an IndexOutput for the file with the given name.
|
IndexInput |
openInput(java.lang.String name,
int bufferSize)
Creates an IndexInput for the file with the given name.
|
close, deleteFile, fileExists, fileLength, fileModified, fileModified, getDirectory, getDirectory, getDirectory, getDirectory, getDirectory, getDirectory, getDisableLocks, getFile, getLockID, getReadChunkSize, initOutput, list, listAll, listAll, open, open, openInput, renameFile, setDisableLocks, setReadChunkSize, sync, toString, touchFile
clearLock, copy, ensureOpen, getLockFactory, makeLock, setLockFactory
public 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
public SimpleFSDirectory(java.io.File path) throws java.io.IOException
NativeFSLockFactory
.path
- the path of the directoryjava.io.IOException
public IndexOutput createOutput(java.lang.String name) throws java.io.IOException
createOutput
in class FSDirectory
java.io.IOException
public IndexInput openInput(java.lang.String name, int bufferSize) throws java.io.IOException
openInput
in class FSDirectory
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.