C# 클래스 Lucene.Net.Store.RAMDirectory

A memory-resident Directory implementation. Locking implementation is by default the SingleInstanceLockFactory but can be changed with #setLockFactory.

Warning: this class is not intended to work with huge indexes. Everything beyond several hundred megabytes will waste resources (GC cycles), because it uses an internal buffer size of 1024 bytes, producing millions of {@code byte[1024]} arrays. this class is optimized for small memory-resident indexes. It also has bad concurrency on multithreaded environments.

It is recommended to materialize large indexes on disk and use MMapDirectory, which is a high-performance directory implementation working directly on the file system cache of the operating system, so copying data to Java heap space is not useful.

상속: Lucene.Net.Store.BaseDirectory
파일 보기 프로젝트 열기: synhershko/lucene.net 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
fileMap RAMFile>.HashMap
internalSizeInBytes long

공개 메소드들

메소드 설명
CreateOutput ( System name ) : Lucene.Net.Store.IndexOutput

Creates a new, empty file in the directory with the given name. Returns a stream writing this file.

DeleteFile ( System name ) : void

Removes an existing file in the directory.

FileExists ( System name ) : bool

Returns true iff the named file exists in this directory.

FileLength ( System name ) : long

Returns the length in bytes of a file in the directory.

FileModified ( System name ) : long

Returns the time the named file was last modified.

ListAll ( ) : System.String[]
OpenInput ( System name ) : IndexInput

Returns a stream reading an existing file.

RAMDirectory ( ) : System

Constructs an empty Directory.

RAMDirectory ( Directory dir ) : System

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.

SizeInBytes ( ) : long

Return total size in bytes of all files in this directory. This is currently quantized to RAMOutputStream.BUFFER_SIZE.

TouchFile ( System name ) : void

Set the modified time of an existing file to now.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Closes the store to future operations, releasing associated memory.

비공개 메소드들

메소드 설명
OnDeserialized ( System context ) : void
RAMDirectory ( Directory dir, bool closeDir ) : System

메소드 상세

CreateOutput() 공개 메소드

Creates a new, empty file in the directory with the given name. Returns a stream writing this file.
public CreateOutput ( System name ) : Lucene.Net.Store.IndexOutput
name System
리턴 Lucene.Net.Store.IndexOutput

DeleteFile() 공개 메소드

Removes an existing file in the directory.
public DeleteFile ( System name ) : void
name System
리턴 void

Dispose() 보호된 메소드

Closes the store to future operations, releasing associated memory.
protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

FileExists() 공개 메소드

Returns true iff the named file exists in this directory.
public FileExists ( System name ) : bool
name System
리턴 bool

FileLength() 공개 메소드

Returns the length in bytes of a file in the directory.
public FileLength ( System name ) : long
name System
리턴 long

FileModified() 공개 메소드

Returns the time the named file was last modified.
public FileModified ( System name ) : long
name System
리턴 long

ListAll() 공개 메소드

public ListAll ( ) : System.String[]
리턴 System.String[]

OpenInput() 공개 메소드

Returns a stream reading an existing file.
public OpenInput ( System name ) : IndexInput
name System
리턴 IndexInput

RAMDirectory() 공개 메소드

Constructs an empty Directory.
public RAMDirectory ( ) : System
리턴 System

RAMDirectory() 공개 메소드

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.

if an error occurs ///
public RAMDirectory ( Directory dir ) : System
dir Directory a Directory value ///
리턴 System

SizeInBytes() 공개 메소드

Return total size in bytes of all files in this directory. This is currently quantized to RAMOutputStream.BUFFER_SIZE.
public SizeInBytes ( ) : long
리턴 long

TouchFile() 공개 메소드

Set the modified time of an existing file to now.
public TouchFile ( System name ) : void
name System
리턴 void

프로퍼티 상세

fileMap 보호되어 있는 프로퍼티

protected HashMap fileMap
리턴 RAMFile>.HashMap

internalSizeInBytes 보호되어 있는 프로퍼티

protected long internalSizeInBytes
리턴 long