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
Mostrar archivo Open project: apache/lucenenet Class Usage Examples

Public Methods

Method 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

Method 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 method

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
return System.Collections.Generic

CreateOutput() public method

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

CreateSlicer() public method

public CreateSlicer ( string name, IOContext context ) : IndexInputSlicer
name string
context IOContext
return IndexInputSlicer

DeleteFile() public method

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

Dispose() public method

public Dispose ( ) : void
return void

FileLength() public method

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

ListAll() public method

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

MakeLock() public method

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

OpenInput() public method

public OpenInput ( string name, IOContext context ) : IndexInput
name string
context IOContext
return IndexInput

RenameFile() public method

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

Sync() public method

public Sync ( ICollection names ) : void
names ICollection
return void

ToString() public method

public ToString ( ) : string
return string