java.lang.Object | ||
↳ | org.apache.lucene.store.Directory | |
↳ | org.apache.lucene.store.RAMDirectory |
A memory-resident Directory
implementation. Locking
implementation is by default the SingleInstanceLockFactory
but can be changed with setLockFactory(LockFactory)
.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.store.Directory
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an empty
Directory . | |||||||||||
Creates a new
RAMDirectory instance from a different
Directory implementation. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Closes the store to future operations, releasing associated memory.
| |||||||||||
Creates a new, empty file in the directory with the given name.
| |||||||||||
Removes an existing file in the directory.
| |||||||||||
Returns true iff the named file exists in this directory.
| |||||||||||
Returns the length in bytes of a file in the directory.
| |||||||||||
Returns the time the named file was last modified.
| |||||||||||
Returns an array of strings, one for each file in the
directory.
| |||||||||||
Returns a stream reading an existing file.
| |||||||||||
Return total size in bytes of all files in this
directory.
| |||||||||||
Set the modified time of an existing file to now.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.lucene.store.Directory
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
java.io.Closeable
|
Creates a new RAMDirectory
instance from a different
Directory
implementation. This can be used to load
a disk-based index into memory.
This should be used only with indices that can fit into memory.
Note that the resulting RAMDirectory
instance is fully
independent from the original Directory
(it is a
complete copy). Any subsequent changes to the
original Directory
will not be visible in the
RAMDirectory
instance.
dir | a Directory value |
---|
IOException | if an error occurs |
---|
Closes the store to future operations, releasing associated memory.
Creates a new, empty file in the directory with the given name. Returns a stream writing this file.
IOException |
---|
Removes an existing file in the directory.
IOException | if the file does not exist |
---|
Returns true iff the named file exists in this directory.
Returns the length in bytes of a file in the directory.
IOException | if the file does not exist |
---|
Returns the time the named file was last modified.
IOException | if the file does not exist |
---|
Returns an array of strings, one for each file in the directory.
Returns a stream reading an existing file.
IOException |
---|
Return total size in bytes of all files in this directory. This is currently quantized to RAMOutputStream.BUFFER_SIZE.
Set the modified time of an existing file to now.
IOException | if the file does not exist |
---|