• API

    Show / Hide Table of Contents

    Class 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 --> WriteHeader(DataOutput, String, Int32)
    • FileCount --> WriteVInt32(Int32)
    • DataOffset,DataLength --> WriteInt64(Int64)
    • FileName --> WriteString(String)
    • FileData --> raw file data
    • Footer --> WriteFooter(IndexOutput)

    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 System.String with that file's name.

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    Directory
    BaseDirectory
    CompoundFileDirectory
    Implements
    System.IDisposable
    Inherited Members
    BaseDirectory.IsOpen
    BaseDirectory.m_lockFactory
    BaseDirectory.ClearLock(String)
    BaseDirectory.SetLockFactory(LockFactory)
    BaseDirectory.LockFactory
    BaseDirectory.EnsureOpen()
    Directory.OpenChecksumInput(String, IOContext)
    Directory.Dispose()
    Directory.GetLockID()
    Directory.Copy(Directory, String, String, IOContext)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public sealed class CompoundFileDirectory : BaseDirectory, IDisposable

    Constructors

    | Improve this Doc View Source

    CompoundFileDirectory(Directory, String, IOContext, Boolean)

    Create a new CompoundFileDirectory.

    Declaration
    public CompoundFileDirectory(Directory directory, string fileName, IOContext context, bool openForWrite)
    Parameters
    Type Name Description
    Directory directory
    System.String fileName
    IOContext context
    System.Boolean openForWrite

    Properties

    | Improve this Doc View Source

    Directory

    Declaration
    public Directory Directory { get; }
    Property Value
    Type Description
    Directory
    | Improve this Doc View Source

    Name

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    CreateOutput(String, IOContext)

    Declaration
    public override IndexOutput CreateOutput(string name, IOContext context)
    Parameters
    Type Name Description
    System.String name
    IOContext context
    Returns
    Type Description
    IndexOutput
    Overrides
    Directory.CreateOutput(String, IOContext)
    | Improve this Doc View Source

    CreateSlicer(String, IOContext)

    Declaration
    public override Directory.IndexInputSlicer CreateSlicer(string name, IOContext context)
    Parameters
    Type Name Description
    System.String name
    IOContext context
    Returns
    Type Description
    Directory.IndexInputSlicer
    Overrides
    Directory.CreateSlicer(String, IOContext)
    | Improve this Doc View Source

    DeleteFile(String)

    Not implemented

    Declaration
    public override void DeleteFile(string name)
    Parameters
    Type Name Description
    System.String name
    Overrides
    Directory.DeleteFile(String)
    Exceptions
    Type Condition
    System.NotSupportedException

    always: not supported by CFS

    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    Directory.Dispose(Boolean)
    | Improve this Doc View Source

    FileExists(String)

    Returns true iff a file with the given name exists.

    Declaration
    [Obsolete("this method will be removed in 5.0")]
    public override bool FileExists(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Boolean
    Overrides
    Directory.FileExists(String)
    | Improve this Doc View Source

    FileLength(String)

    Returns the length of a file in the directory.

    Declaration
    public override long FileLength(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    System.Int64
    Overrides
    Directory.FileLength(String)
    Exceptions
    Type Condition
    System.IO.IOException

    if the file does not exist

    | Improve this Doc View Source

    ListAll()

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

    Declaration
    public override string[] ListAll()
    Returns
    Type Description
    System.String[]
    Overrides
    Directory.ListAll()
    | Improve this Doc View Source

    MakeLock(String)

    Not implemented

    Declaration
    public override Lock MakeLock(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    Lock
    Overrides
    BaseDirectory.MakeLock(String)
    Exceptions
    Type Condition
    System.NotSupportedException

    always: not supported by CFS

    | Improve this Doc View Source

    OpenInput(String, IOContext)

    Declaration
    public override IndexInput OpenInput(string name, IOContext context)
    Parameters
    Type Name Description
    System.String name
    IOContext context
    Returns
    Type Description
    IndexInput
    Overrides
    Directory.OpenInput(String, IOContext)
    | Improve this Doc View Source

    RenameFile(String, String)

    Not implemented

    Declaration
    public void RenameFile(string from, string to)
    Parameters
    Type Name Description
    System.String from
    System.String to
    Exceptions
    Type Condition
    System.NotSupportedException

    always: not supported by CFS

    | Improve this Doc View Source

    Sync(ICollection<String>)

    Declaration
    public override void Sync(ICollection<string> names)
    Parameters
    Type Name Description
    System.Collections.Generic.ICollection<System.String> names
    Overrides
    Directory.Sync(ICollection<String>)
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    Directory.ToString()

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)