Method Open
Open(DirectoryInfo)
Creates an FSDirectory instance, trying to pick the best implementation given the current environment. The directory returned uses the NativeFSLockFactory.
Currently this returns MMapDirectory for most Solaris and Windows 64-bit runtimes, NIOFSDirectory for other non-Windows runtimes, and SimpleFSDirectory for other runtimes on Windows. It is highly recommended that you consult the implementation's documentation for your platform before using this method.
NOTE: this method may suddenly change which implementation is returned from release to release, in the event that higher performance defaults become possible; if the precise implementation is important to your application, please instantiate it directly, instead. For optimal performance you should consider using MMapDirectory on 64 bit runtimes.
See FSDirectory.
Declaration
public static FSDirectory Open(DirectoryInfo path)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | path |
Returns
Type | Description |
---|---|
FSDirectory |
Open(String)
Just like Open(DirectoryInfo), but
allows you to specify the directory as a
Declaration
public static FSDirectory Open(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path (to a directory) to open |
Returns
Type | Description |
---|---|
FSDirectory | An open FSDirectory |
Open(DirectoryInfo, LockFactory, Int32)
Just like Open(DirectoryInfo), but allows you to also specify a custom LockFactory.
Declaration
public static FSDirectory Open(DirectoryInfo path, LockFactory lockFactory, int bucketId = 0)
Parameters
Type | Name | Description |
---|---|---|
DirectoryInfo | path | |
LockFactory | lockFactory | |
System.Int32 | bucketId |
Returns
Type | Description |
---|---|
FSDirectory |
Open(String, LockFactory, Int32)
Just like
Declaration
public static FSDirectory Open(string path, LockFactory lockFactory, int bucketId = 0)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | The path (to a directory) to open |
LockFactory | lockFactory | |
System.Int32 | bucketId |
Returns
Type | Description |
---|---|
FSDirectory | An open FSDirectory |