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
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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