C# Class 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
Inheritance: Lucene.Net.Store.BaseDirectory
Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Méthodes publiques

Méthode Description
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

Private Methods

Méthode Description
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

Method Details

CompoundFileDirectory() public méthode

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
Résultat System.Collections.Generic

CreateOutput() public méthode

public CreateOutput ( string name, IOContext context ) : Lucene.Net.Store.IndexOutput
name string
context IOContext
Résultat Lucene.Net.Store.IndexOutput

CreateSlicer() public méthode

public CreateSlicer ( string name, IOContext context ) : IndexInputSlicer
name string
context IOContext
Résultat IndexInputSlicer

DeleteFile() public méthode

Not implemented
always: not supported by CFS
public DeleteFile ( string name ) : void
name string
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

FileLength() public méthode

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

ListAll() public méthode

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

MakeLock() public méthode

Not implemented
always: not supported by CFS
public MakeLock ( string name ) : Lock
name string
Résultat Lock

OpenInput() public méthode

public OpenInput ( string name, IOContext context ) : IndexInput
name string
context IOContext
Résultat IndexInput

RenameFile() public méthode

Not implemented
always: not supported by CFS
public RenameFile ( string from, string to ) : void
from string
to string
Résultat void

Sync() public méthode

public Sync ( ICollection names ) : void
names ICollection
Résultat void

ToString() public méthode

public ToString ( ) : string
Résultat string