The MMapDirectory type exposes the following members.

Constructors

  NameDescription
Public methodMMapDirectory(DirectoryInfo)
Create a new MMapDirectory for the named location and the default lock factory.
Public methodMMapDirectory(FileInfo) Obsolete.
Create a new MMapDirectory for the named location and the default lock factory.
Public methodMMapDirectory(DirectoryInfo, LockFactory)
Create a new MMapDirectory for the named location.
Public methodMMapDirectory(FileInfo, LockFactory) Obsolete.
Create a new MMapDirectory for the named location.

Methods

  NameDescription
Public methodClearLock
Attempt to clear (forcefully unlock and remove) the specified lock. Only call this at a time when you are certain this lock is no longer in use.
(Inherited from Directory.)
Public methodClose
Closes the store to future operations.
(Inherited from FSDirectory.)
Public methodCreateOutput
Creates an IndexOutput for the file with the given name.
(Overrides FSDirectory..::..CreateOutput(String).)
Public methodDeleteFile
Removes an existing file in the directory.
(Inherited from FSDirectory.)
Public methodDispose
.NET
(Inherited from FSDirectory.)
Public methodEnsureOpen (Inherited from Directory.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFileExists
Returns true iff a file with the given name exists.
(Inherited from FSDirectory.)
Public methodFileLength
Returns the length in bytes of a file in the directory.
(Inherited from FSDirectory.)
Public methodFileModified(String)
Returns the time the named file was last modified.
(Inherited from FSDirectory.)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetDirectory()()()() (Inherited from FSDirectory.)
Public methodGetFile Obsolete. (Inherited from FSDirectory.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetLockFactory
Get the LockFactory that this Directory instance is using for its locking implementation. Note that this may be null for Directory implementations that provide their own locking implementation.
(Inherited from Directory.)
Public methodGetLockID (Inherited from FSDirectory.)
Public methodGetMaxChunkSize
Returns the current mmap chunk size.
Public methodGetReadChunkSize
The maximum number of bytes to read at once from the underlying file during {@link IndexInput#readBytes}.
(Inherited from FSDirectory.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetUseUnmap
Returns
CopyC#
true
, if the unmap workaround is enabled.
Protected methodInitOutput
Initializes the directory to create a new file with the given name. This method should be used in {@link #createOutput}.
(Inherited from FSDirectory.)
Public methodList Obsolete. (Inherited from FSDirectory.)
Public methodListAll()()()()
Lists all files (not subdirectories) in the directory.
(Inherited from FSDirectory.)
Public methodMakeLock
Construct a {@link Lock}.
(Inherited from Directory.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOpenInput(String) (Inherited from FSDirectory.)
Public methodOpenInput(String, Int32)
Creates an IndexInput for the file with the given name.
(Overrides FSDirectory..::..OpenInput(String, Int32).)
Public methodRenameFile Obsolete.
Renames an existing file in the directory. Warning: This is not atomic.
(Inherited from FSDirectory.)
Public methodSetLockFactory
Set the LockFactory that this Directory instance should use for its locking implementation. Each * instance of LockFactory should only be used for one directory (ie, do not share a single instance across multiple Directories).
(Inherited from Directory.)
Public methodSetMaxChunkSize
Sets the maximum chunk size (default is {@link Integer#MAX_VALUE} for 64 bit JVMs and 256 MiBytes for 32 bit JVMs) used for memory mapping. Especially on 32 bit platform, the address space can be very fragmented, so large index files cannot be mapped. Using a lower chunk size makes the directory implementation a little bit slower (as the correct chunk must be resolved on each seek) but the chance is higher that mmap does not fail. On 64 bit Java platforms, this parameter should always be {@link Integer#MAX_VALUE}, as the adress space is big enough.
Public methodSetReadChunkSize
Sets the maximum number of bytes read at once from the underlying file during {@link IndexInput#readBytes}. The default value is {@link #DEFAULT_READ_CHUNK_SIZE};

This was introduced due to Sun JVM Bug 6478546, which throws an incorrect OutOfMemoryError when attempting to read too many bytes at once. It only happens on 32bit JVMs with a large maximum heap size.

Changes to this value will not impact any already-opened {@link IndexInput}s. You should call this before attempting to open an index on the directory.

NOTE: This value should be as large as possible to reduce any possible performance impact. If you still encounter an incorrect OutOfMemoryError, trying lowering the chunk size.

(Inherited from FSDirectory.)
Public methodSetUseUnmap
This method enables the workaround for unmapping the buffers from address space after closing {@link IndexInput}, that is mentioned in the bug report. This hack may fail on non-Sun JVMs. It forcefully unmaps the buffer on close by using an undocumented internal cleanup functionality.

NOTE: Enabling this is completely unsupported by Java and may lead to JVM crashs if

CopyC#
IndexInput
is closed while another thread is still accessing it (SIGSEGV).
Public methodSync (Inherited from FSDirectory.)
Public methodToString
For debug output.
(Inherited from FSDirectory.)
Public methodTouchFile
Set the modified time of an existing file to now.
(Inherited from FSDirectory.)

Fields

  NameDescription
Protected fielddirectory
The underlying filesystem directory
(Inherited from FSDirectory.)
Protected fieldisOpen (Inherited from Directory.)
Protected fieldlockFactory
Holds the LockFactory instance (implements locking for this Directory instance).
(Inherited from Directory.)
Public fieldStatic memberUNMAP_SUPPORTED
CopyC#
true
, if this platform supports unmapping mmaped files.

Properties

  NameDescription
Public propertyisOpen_ForNUnit (Inherited from Directory.)

See Also