Class SurrogateNCacheDirectory
Base class for Directory implementations that store index files in the file system.
There are currently three core subclasses:
- SimpleFSDirectory is a straightforward implementation using System.IO.FileStream. However, it has poor concurrent performance (multiple threads will bottleneck) as it synchronizes when multiple threads read from the same file.
- NIOFSDirectory uses java.nio's FileChannel's positional io when reading to avoid synchronization when reading from the same file. Unfortunately, due to a Windows-only Sun JRE bug this is a poor choice for Windows, but on all other platforms this is the preferred choice. Applications using System.Threading.Thread.Interrupt or System.Threading.Tasks.Task<TResult> should use SimpleFSDirectory instead. See NIOFSDirectory java doc for details.
- MMapDirectory uses memory-mapped IO when
reading. This is a good choice if you have plenty
of virtual memory relative to your index size, eg
if you are running on a 64 bit runtime, or you are
running on a 32 bit runtime but your index sizes are
small enough to fit into the virtual memory space.
Applications using System.Threading.Thread.Interrupt or System.Threading.Tasks.Task should use SimpleFSDirectory instead. See MMapDirectory doc for details.
Unfortunately, because of system peculiarities, there is
no single overall best implementation. Therefore, we've
added the
The locking implementation is by default NativeFSLockFactory, but can be changed by passing in a custom LockFactory instance.
Inheritance
Assembly: Lucene.Net.dll
Syntax
[Serializable]
public class SurrogateNCacheDirectory : ServerSurrogateObject
Constructors
Name | Description |
---|---|
SurrogateNCacheDirectory(String, String, String, String, LockFactory, CacheContext, Byte[]) |
Fields
Name | Description |
---|---|
DEFAULT_READ_CHUNK_SIZE | Default read chunk size: 8192 bytes (this is the size up to which the runtime does not allocate additional arrays while reading/writing) |
DirectoryPath | |
MAIN_DIR | |
REPLICA_DIR |
Properties
Name | Description |
---|---|
_RPCCallInfo | |
CacheContext | |
ClientID | |
ClientUID | |
Directory | |
Disposed | |
HasWriterOpened | |
IndexName | |
IndexPath | |
Length | |
PermanentLocalBucketIds | |
ReadChunkSize | this setting has no effect anymore. |
WrappedInstance |