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

Class for accessing a compound stream. this class implements a directory, but is limited to only read operations. Directory methods that would normally modify data throw an exception.

All files belonging to a segment have the same name with varying extensions. The extensions correspond to the different file formats used by the Codec. When using the Compound File format these files are collapsed into a single .cfs file (except for the LiveDocsFormat, with a corresponding .cfe file indexing its sub-files.

Files:

  • .cfs: An optional "virtual" file consisting of all the other index files for systems that frequently run out of file handles.
  • .cfe: The "virtual" compound file's entry table holding all entries in the corresponding .cfs file.

Description:

  • Compound (.cfs) --> Header, FileData FileCount
  • Compound Entry Table (.cfe) --> Header, FileCount, <FileName, DataOffset, DataLength> FileCount, Footer
  • Header --> CodecUtil#writeHeader CodecHeader
  • FileCount --> DataOutput#writeVInt VInt
  • DataOffset,DataLength --> DataOutput#writeLong UInt64
  • FileName --> DataOutput#writeString String
  • FileData --> raw file data
  • Footer --> CodecUtil#writeFooter CodecFooter

Notes:

  • FileCount indicates how many files are contained in this compound file. The entry table that follows has that many entries.
  • Each directory entry contains a long pointer to the start of this file's data section, the files length, and a String with that file's name.
@lucene.experimental
상속: Lucene.Net.Store.BaseDirectory
파일 보기 프로젝트 열기: apache/lucenenet 1 사용 예제들

공개 메소드들

메소드 설명
CompoundFileDirectory ( Lucene.Net.Store.Directory directory, string fileName, IOContext context, bool openForWrite ) : System.Collections.Generic

Create a new CompoundFileDirectory.

CreateOutput ( string name, IOContext context ) : Lucene.Net.Store.IndexOutput
CreateSlicer ( string name, IOContext context ) : IndexInputSlicer
DeleteFile ( string name ) : void

Not implemented

Dispose ( ) : void
FileLength ( string name ) : long

Returns the length of a file in the directory.

ListAll ( ) : string[]

Returns an array of strings, one for each file in the directory.

MakeLock ( string name ) : Lock

Not implemented

OpenInput ( string name, IOContext context ) : IndexInput
RenameFile ( string from, string to ) : void

Not implemented

Sync ( ICollection names ) : void
ToString ( ) : string

비공개 메소드들

메소드 설명
FileExists ( string name ) : bool
ReadEntries ( IndexInputSlicer handle, Lucene.Net.Store.Directory dir, string name ) : FileEntry>.IDictionary

Helper method that reads CFS entries from an input stream

ReadLegacyEntries ( IndexInput stream, int firstInt ) : FileEntry>.IDictionary

메소드 상세

CompoundFileDirectory() 공개 메소드

Create a new CompoundFileDirectory.
public CompoundFileDirectory ( Lucene.Net.Store.Directory directory, string fileName, IOContext context, bool openForWrite ) : System.Collections.Generic
directory Lucene.Net.Store.Directory
fileName string
context IOContext
openForWrite bool
리턴 System.Collections.Generic

CreateOutput() 공개 메소드

public CreateOutput ( string name, IOContext context ) : Lucene.Net.Store.IndexOutput
name string
context IOContext
리턴 Lucene.Net.Store.IndexOutput

CreateSlicer() 공개 메소드

public CreateSlicer ( string name, IOContext context ) : IndexInputSlicer
name string
context IOContext
리턴 IndexInputSlicer

DeleteFile() 공개 메소드

Not implemented
always: not supported by CFS
public DeleteFile ( string name ) : void
name string
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

FileLength() 공개 메소드

Returns the length of a file in the directory.
if the file does not exist
public FileLength ( string name ) : long
name string
리턴 long

ListAll() 공개 메소드

Returns an array of strings, one for each file in the directory.
public ListAll ( ) : string[]
리턴 string[]

MakeLock() 공개 메소드

Not implemented
always: not supported by CFS
public MakeLock ( string name ) : Lock
name string
리턴 Lock

OpenInput() 공개 메소드

public OpenInput ( string name, IOContext context ) : IndexInput
name string
context IOContext
리턴 IndexInput

RenameFile() 공개 메소드

Not implemented
always: not supported by CFS
public RenameFile ( string from, string to ) : void
from string
to string
리턴 void

Sync() 공개 메소드

public Sync ( ICollection names ) : void
names ICollection
리턴 void

ToString() 공개 메소드

public ToString ( ) : string
리턴 string