Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 1E8EA200CC5 for ; Tue, 6 Jun 2017 02:11:43 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1D583160BE1; Tue, 6 Jun 2017 00:11:43 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id C4B76160BEC for ; Tue, 6 Jun 2017 02:11:39 +0200 (CEST) Received: (qmail 66031 invoked by uid 500); 6 Jun 2017 00:11:38 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 63788 invoked by uid 99); 6 Jun 2017 00:11:35 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2017 00:11:35 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 82167DFFAB; Tue, 6 Jun 2017 00:11:35 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Tue, 06 Jun 2017 00:12:08 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [35/48] lucenenet git commit: Lucene.Net.Codecs: Fixed XML documentation comments (excluding sub-namespaces) archived-at: Tue, 06 Jun 2017 00:11:43 -0000 Lucene.Net.Codecs: Fixed XML documentation comments (excluding sub-namespaces) Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/a08ae945 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/a08ae945 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/a08ae945 Branch: refs/heads/master Commit: a08ae9451435e960821b6a45c9134c40ce40cc3c Parents: d4e4498 Author: Shad Storhaug Authored: Mon Jun 5 05:12:52 2017 +0700 Committer: Shad Storhaug Committed: Tue Jun 6 06:58:39 2017 +0700 ---------------------------------------------------------------------- CONTRIBUTING.md | 20 +- src/Lucene.Net/Codecs/BlockTermState.cs | 14 +- src/Lucene.Net/Codecs/BlockTreeTermsReader.cs | 92 ++-- src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs | 172 +++--- src/Lucene.Net/Codecs/Codec.cs | 28 +- src/Lucene.Net/Codecs/CodecUtil.cs | 124 +++-- src/Lucene.Net/Codecs/DocValuesConsumer.cs | 525 ++----------------- src/Lucene.Net/Codecs/DocValuesFormat.cs | 10 +- src/Lucene.Net/Codecs/DocValuesProducer.cs | 49 +- src/Lucene.Net/Codecs/FieldInfosFormat.cs | 13 +- src/Lucene.Net/Codecs/FieldInfosReader.cs | 9 +- src/Lucene.Net/Codecs/FieldInfosWriter.cs | 9 +- src/Lucene.Net/Codecs/FieldsConsumer.cs | 35 +- src/Lucene.Net/Codecs/FieldsProducer.cs | 18 +- src/Lucene.Net/Codecs/FilterCodec.cs | 38 +- src/Lucene.Net/Codecs/LiveDocsFormat.cs | 13 +- .../Codecs/Lucene41/Lucene41PostingsFormat.cs | 4 +- .../Codecs/MappingMultiDocsAndPositionsEnum.cs | 8 +- src/Lucene.Net/Codecs/MappingMultiDocsEnum.cs | 8 +- .../Codecs/MultiLevelSkipListReader.cs | 51 +- .../Codecs/MultiLevelSkipListWriter.cs | 38 +- src/Lucene.Net/Codecs/NormsFormat.cs | 14 +- src/Lucene.Net/Codecs/PostingsBaseFormat.cs | 16 +- src/Lucene.Net/Codecs/PostingsConsumer.cs | 48 +- src/Lucene.Net/Codecs/PostingsFormat.cs | 16 +- src/Lucene.Net/Codecs/PostingsReaderBase.cs | 44 +- src/Lucene.Net/Codecs/PostingsWriterBase.cs | 55 +- src/Lucene.Net/Codecs/SegmentInfoFormat.cs | 18 +- src/Lucene.Net/Codecs/SegmentInfoReader.cs | 17 +- src/Lucene.Net/Codecs/SegmentInfoWriter.cs | 10 +- src/Lucene.Net/Codecs/StoredFieldsFormat.cs | 12 +- src/Lucene.Net/Codecs/StoredFieldsReader.cs | 26 +- src/Lucene.Net/Codecs/StoredFieldsWriter.cs | 67 +-- src/Lucene.Net/Codecs/TermStats.cs | 8 +- src/Lucene.Net/Codecs/TermVectorsFormat.cs | 12 +- src/Lucene.Net/Codecs/TermVectorsReader.cs | 25 +- src/Lucene.Net/Codecs/TermVectorsWriter.cs | 109 ++-- src/Lucene.Net/Codecs/TermsConsumer.cs | 48 +- 38 files changed, 745 insertions(+), 1078 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/CONTRIBUTING.md ---------------------------------------------------------------------- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ccfa22a..dafe5a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,9 +51,25 @@ helpers to help with that, see for examples see our [Java style methods to avoid ### Documentation Comments == up for grabs: 1. Lucene.Net.Core (project) - 1. Codecs (namespace) - 2. Util.Packed (namespace) + 1. Codecs.Compressing (namespace) + 2. Codecs.Lucene3x (namespace) + 3. Codecs.Lucene40 (namespace) + 4. Codecs.Lucene41 (namespace) + 5. Codecs.Lucene42 (namespace) + 6. Codecs.Lucene45 (namespace) + 7. Codecs.Lucene46 (namespace) + 8. Codecs.PerField (namespace) + 9. Util.Packed (namespace) 2. Lucene.Net.Codecs (project) + 1. Appending (namespace) + 2. BlockTerms (namespace) + 3. Bloom (namespace) + 4. DiskDV (namespace) + 5. IntBlock (namespace) + 6. Memory (namespace) + 7. Pulsing (namespace) + 8. Sep (namespace) + 9. SimpleText (namespace) See [Documenting Lucene.Net](https://cwiki.apache.org/confluence/display/LUCENENET/Documenting+Lucene.Net) for instructions. http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/BlockTermState.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/BlockTermState.cs b/src/Lucene.Net/Codecs/BlockTermState.cs index acd8723..e799921 100644 --- a/src/Lucene.Net/Codecs/BlockTermState.cs +++ b/src/Lucene.Net/Codecs/BlockTermState.cs @@ -24,32 +24,32 @@ namespace Lucene.Net.Codecs using TermState = Lucene.Net.Index.TermState; /// - /// Holds all state required for - /// to produce a without re-seeking the + /// Holds all state required for + /// to produce a without re-seeking the /// terms dict. /// public class BlockTermState : OrdTermState { /// - /// how many docs have this term + /// How many docs have this term? public int DocFreq { get; set; } /// - /// total number of occurrences of this term + /// Total number of occurrences of this term. public long TotalTermFreq { get; set; } /// - /// the term's ord in the current block + /// The term's ord in the current block. public int TermBlockOrd { get; set; } /// - /// fp into the terms dict primary file (_X.tim) that holds this term + /// File pointer into the terms dict primary file (_X.tim) that holds this term. // TODO: update BTR to nuke this public long BlockFilePointer { get; set; } /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal BlockTermState() { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs b/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs index fedc3b0..b4a73bf 100644 --- a/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs +++ b/src/Lucene.Net/Codecs/BlockTreeTermsReader.cs @@ -54,32 +54,32 @@ namespace Lucene.Net.Codecs /// /// A block-based terms index and dictionary that assigns - /// terms to variable length blocks according to how they - /// share prefixes. The terms index is a prefix trie - /// whose leaves are term blocks. The advantage of this - /// approach is that seekExact is often able to - /// determine a term cannot exist without doing any IO, and - /// intersection with Automata is very fast. Note that this - /// terms dictionary has it's own fixed terms index (ie, it - /// does not support a pluggable terms index - /// implementation). + /// terms to variable length blocks according to how they + /// share prefixes. The terms index is a prefix trie + /// whose leaves are term blocks. The advantage of this + /// approach is that SeekExact() is often able to + /// determine a term cannot exist without doing any IO, and + /// intersection with Automata is very fast. Note that this + /// terms dictionary has it's own fixed terms index (ie, it + /// does not support a pluggable terms index + /// implementation). /// - ///

NOTE: this terms dictionary does not support - /// index divisor when opening an IndexReader. Instead, you - /// can change the min/maxItemsPerBlock during indexing.

+ /// NOTE: this terms dictionary does not support + /// index divisor when opening an IndexReader. Instead, you + /// can change the min/maxItemsPerBlock during indexing. /// - ///

The data structure used by this implementation is very - /// similar to a burst trie - /// (http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499), - /// but with added logic to break up too-large blocks of all - /// terms sharing a given prefix into smaller ones.

+ /// The data structure used by this implementation is very + /// similar to a burst trie + /// (http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.18.3499), + /// but with added logic to break up too-large blocks of all + /// terms sharing a given prefix into smaller ones. /// - ///

Use with the -verbose - /// option to see summary statistics on the blocks in the - /// dictionary. - /// - /// See . + /// Use with the -verbose + /// option to see summary statistics on the blocks in the + /// dictionary. /// + /// See . + /// /// @lucene.experimental ///

public class BlockTreeTermsReader : FieldsProducer @@ -242,7 +242,7 @@ namespace Lucene.Net.Codecs } /// - /// Seek {@code input} to the directory offset. + /// Seek to the directory offset. protected internal virtual void SeekDir(IndexInput input, long dirOffset) { if (version >= BlockTreeTermsWriter.VERSION_CHECKSUM) @@ -263,6 +263,9 @@ namespace Lucene.Net.Codecs // return "0x" + Integer.toHexString(v); // } + /// + /// Disposes all resources used by this object. + /// protected override void Dispose(bool disposing) { if (disposing) @@ -323,7 +326,7 @@ namespace Lucene.Net.Codecs /// /// BlockTree statistics for a single field - /// returned by . + /// returned by . /// public class Stats { @@ -353,7 +356,7 @@ namespace Lucene.Net.Codecs /// /// The number of floor blocks (meta-blocks larger than the - /// allowed {@code maxItemsPerBlock}) in the terms file. + /// allowed maxItemsPerBlock) in the terms file. /// public int FloorBlockCount { get; set; } @@ -403,14 +406,14 @@ namespace Lucene.Net.Codecs /// /// Total number of bytes used to store term stats (not - /// including what the - /// stores. + /// including what the + /// stores. /// public long TotalBlockStatsBytes { get; set; } /// - /// Total bytes stored by the , - /// plus the other few vInts stored in the frame. + /// Total bytes stored by the , + /// plus the other few vInts stored in the frame. /// public long TotalBlockOtherBytes { get; set; } @@ -538,7 +541,7 @@ namespace Lucene.Net.Codecs internal BytesRef NO_OUTPUT; /// - /// BlockTree's implementation of . + /// BlockTree's implementation of . public sealed class FieldReader : Terms { private readonly BlockTreeTermsReader outerInstance; @@ -2808,16 +2811,17 @@ namespace Lucene.Net.Codecs LoadBlock(); } - /* Does initial decode of next block of terms; this - doesn't actually decode the docFreq, totalTermFreq, - postings details (frq/prx offset, etc.) metadata; - it just loads them as byte[] blobs which are then - decoded on-demand if the metadata is ever requested - for any term in this block. this enables terms-only - intensive consumes (eg certain MTQs, respelling) to - not pay the price of decoding metadata they won't - use. */ - + /// + /// Does initial decode of next block of terms; this + /// doesn't actually decode the docFreq, totalTermFreq, + /// postings details (frq/prx offset, etc.) metadata; + /// it just loads them as byte[] blobs which are then + /// decoded on-demand if the metadata is ever requested + /// for any term in this block. this enables terms-only + /// intensive consumes (eg certain MTQs, respelling) to + /// not pay the price of decoding metadata they won't + /// use. + /// internal void LoadBlock() { // Clone the IndexInput lazily, so that consumers @@ -3144,9 +3148,11 @@ namespace Lucene.Net.Codecs return true; } - // Scans to sub-block that has this target fp; only - // called by next(); NOTE: does not set - // startBytePos/suffix as a side effect + /// + /// Scans to sub-block that has this target fp; only + /// called by Next(); NOTE: does not set + /// startBytePos/suffix as a side effect + /// public void ScanToSubBlock(long subFP) { Debug.Assert(!isLeafBlock); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs index 4b5df96..a0aafe4 100644 --- a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs +++ b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs @@ -71,120 +71,121 @@ namespace Lucene.Net.Codecs /// /// Block-based terms index and dictionary writer. - ///

+ /// /// Writes terms dict and index, block-encoding (column /// stride) each term's metadata for each set of terms /// between two index terms. - ///

+ /// /// Files: - ///

- ///

+ /// + /// .tim: Term Dictionary + /// .tip: Term Index + /// + /// /// ///

Term Dictionary

/// - ///

The .tim file contains the list of terms in each + /// The .tim file contains the list of terms in each /// field along with per-term statistics (such as docfreq) /// and per-term metadata (typically pointers to the postings list /// for that term in the inverted index). - ///

+ /// /// - ///

The .tim is arranged in blocks: with blocks containing + /// The .tim is arranged in blocks: with blocks containing /// a variable number of entries (by default 25-48), where /// each entry is either a term or a reference to a - /// sub-block.

+ /// sub-block. /// - ///

NOTE: The term dictionary can plug into different postings implementations: + /// NOTE: The term dictionary can plug into different postings implementations: /// the postings writer/reader are actually responsible for encoding - /// and decoding the Postings Metadata and Term Metadata sections.

+ /// and decoding the Postings Metadata and Term Metadata sections. /// - ///
    - ///
  • TermsDict (.tim) --> Header, PostingsHeader, NodeBlockNumBlocks, - /// FieldSummary, DirOffset, Footer
  • - ///
  • NodeBlock --> (OuterNode | InnerNode)
  • - ///
  • OuterNode --> EntryCount, SuffixLength, ByteSuffixLength, StatsLength, < TermStats >EntryCount, MetaLength, <TermMetadata>EntryCount
  • - ///
  • InnerNode --> EntryCount, SuffixLength[,Sub?], ByteSuffixLength, StatsLength, < TermStats ? >EntryCount, MetaLength, <TermMetadata ? >EntryCount
  • - ///
  • TermStats --> DocFreq, TotalTermFreq
  • - ///
  • FieldSummary --> NumFields, <FieldNumber, NumTerms, RootCodeLength, ByteRootCodeLength, - /// SumTotalTermFreq?, SumDocFreq, DocCount>NumFields
  • - ///
  • Header -->
  • - ///
  • DirOffset -->
  • - ///
  • EntryCount,SuffixLength,StatsLength,DocFreq,MetaLength,NumFields, - /// FieldNumber,RootCodeLength,DocCount -->
  • - ///
  • TotalTermFreq,NumTerms,SumTotalTermFreq,SumDocFreq --> - ///
  • - ///
  • Footer -->
  • - ///
- ///

Notes:

- ///
    - ///
  • Header is a storing the version information - /// for the BlockTree implementation.
  • - ///
  • DirOffset is a pointer to the FieldSummary section.
  • - ///
  • DocFreq is the count of documents which contain the term.
  • - ///
  • TotalTermFreq is the total number of occurrences of the term. this is encoded - /// as the difference between the total number of occurrences and the DocFreq.
  • - ///
  • FieldNumber is the fields number from . (.fnm)
  • - ///
  • NumTerms is the number of unique terms for the field.
  • - ///
  • RootCode points to the root block for the field.
  • - ///
  • SumDocFreq is the total number of postings, the number of term-document pairs across - /// the entire field.
  • - ///
  • DocCount is the number of documents that have at least one posting for this field.
  • - ///
  • PostingsHeader and TermMetadata are plugged into by the specific postings implementation: + /// + /// TermsDict (.tim) --> Header, PostingsHeader, NodeBlockNumBlocks, + /// FieldSummary, DirOffset, Footer + /// NodeBlock --> (OuterNode | InnerNode) + /// OuterNode --> EntryCount, SuffixLength, ByteSuffixLength, StatsLength, < TermStats >EntryCount, MetaLength, <TermMetadata>EntryCount + /// InnerNode --> EntryCount, SuffixLength[,Sub?], ByteSuffixLength, StatsLength, < TermStats ? >EntryCount, MetaLength, <TermMetadata ? >EntryCount + /// TermStats --> DocFreq, TotalTermFreq + /// FieldSummary --> NumFields, <FieldNumber, NumTerms, RootCodeLength, ByteRootCodeLength, + /// SumTotalTermFreq?, SumDocFreq, DocCount>NumFields + /// Header --> CodecHeader ( + /// DirOffset --> Uint64 () + /// EntryCount,SuffixLength,StatsLength,DocFreq,MetaLength,NumFields, + /// FieldNumber,RootCodeLength,DocCount --> VInt (_ + /// TotalTermFreq,NumTerms,SumTotalTermFreq,SumDocFreq --> + /// VLong () + /// Footer --> CodecFooter () + /// + /// Notes: + /// + /// Header is a CodecHeader () storing the version information + /// for the BlockTree implementation. + /// DirOffset is a pointer to the FieldSummary section. + /// DocFreq is the count of documents which contain the term. + /// TotalTermFreq is the total number of occurrences of the term. this is encoded + /// as the difference between the total number of occurrences and the DocFreq. + /// FieldNumber is the fields number from . (.fnm) + /// NumTerms is the number of unique terms for the field. + /// RootCode points to the root block for the field. + /// SumDocFreq is the total number of postings, the number of term-document pairs across + /// the entire field. + /// DocCount is the number of documents that have at least one posting for this field. + /// PostingsHeader and TermMetadata are plugged into by the specific postings implementation: /// these contain arbitrary per-file data (such as parameters or versioning information) - /// and per-term data (such as pointers to inverted files).
  • - ///
  • For inner nodes of the tree, every entry will steal one bit to mark whether it points - /// to child nodes(sub-block). If so, the corresponding TermStats and TermMetaData are omitted
  • - ///
+ /// and per-term data (such as pointers to inverted files). + /// For inner nodes of the tree, every entry will steal one bit to mark whether it points + /// to child nodes(sub-block). If so, the corresponding and TermMetadata are omitted + /// /// ///

Term Index

- ///

The .tip file contains an index into the term dictionary, so that it can be + /// The .tip file contains an index into the term dictionary, so that it can be /// accessed randomly. The index is also used to determine - /// when a given term cannot exist on disk (in the .tim file), saving a disk seek.

- ///
    - ///
  • TermsIndex (.tip) --> Header, FSTIndexNumFields - /// <IndexStartFP>NumFields, DirOffset, Footer
  • - ///
  • Header -->
  • - ///
  • DirOffset -->
  • - ///
  • IndexStartFP -->
  • + /// when a given term cannot exist on disk (in the .tim file), saving a disk seek. + /// + /// TermsIndex (.tip) --> Header, FSTIndexNumFields + /// <IndexStartFP>NumFields, DirOffset, Footer + /// Header --> CodecHeader () + /// DirOffset --> Uint64 () + /// IndexStartFP --> VLong () /// - ///
  • FSTIndex -->
  • - ///
  • Footer -->
  • - ///
- ///

Notes:

- ///
    - ///
  • The .tip file contains a separate FST for each + /// FSTIndex --> + /// Footer --> CodecFooter ( + /// + /// Notes: + /// + /// The .tip file contains a separate FST for each /// field. The FST maps a term prefix to the on-disk /// block that holds all terms starting with that /// prefix. Each field's IndexStartFP points to its - /// FST.
  • - ///
  • DirOffset is a pointer to the start of the IndexStartFPs - /// for all fields
  • - ///
  • It's possible that an on-disk block would contain + /// FST. + /// DirOffset is a pointer to the start of the IndexStartFPs + /// for all fields + /// It's possible that an on-disk block would contain /// too many terms (more than the allowed maximum /// (default: 48)). When this happens, the block is /// sub-divided into new blocks (called "floor /// blocks"), and then the output in the FST for the /// block's prefix encodes the leading byte of each - /// sub-block, and its file pointer. - ///
+ /// sub-block, and its file pointer. + /// + /// + /// @lucene.experimental ///
- /// + /// public class BlockTreeTermsWriter : FieldsConsumer { /// - /// Suggested default value for the {@code - /// minItemsInBlock} parameter to {@link - /// #BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int)}. + /// Suggested default value for the + /// minItemsInBlock parameter to + /// . /// public const int DEFAULT_MIN_BLOCK_SIZE = 25; /// - /// Suggested default value for the {@code - /// maxItemsInBlock} parameter to {@link - /// #BlockTreeTermsWriter(SegmentWriteState,PostingsWriterBase,int,int)}. + /// Suggested default value for the + /// maxItemsInBlock parameter to + /// . /// public const int DEFAULT_MAX_BLOCK_SIZE = 48; @@ -197,7 +198,7 @@ namespace Lucene.Net.Codecs internal const int OUTPUT_FLAG_HAS_TERMS = 0x2; /// - /// Extension of terms file + /// Extension of terms file. internal const string TERMS_EXTENSION = "tim"; internal const string TERMS_CODEC_NAME = "BLOCK_TREE_TERMS_DICT"; @@ -211,11 +212,11 @@ namespace Lucene.Net.Codecs public const int VERSION_APPEND_ONLY = 1; /// - /// Meta data as array + /// Meta data as array. public const int VERSION_META_ARRAY = 2; /// - /// checksums + /// Checksums. public const int VERSION_CHECKSUM = 3; /// @@ -223,7 +224,7 @@ namespace Lucene.Net.Codecs public const int VERSION_CURRENT = VERSION_CHECKSUM; /// - /// Extension of terms index file + /// Extension of terms index file. internal const string TERMS_INDEX_EXTENSION = "tip"; internal const string TERMS_INDEX_CODEC_NAME = "BLOCK_TREE_TERMS_INDEX"; @@ -272,9 +273,9 @@ namespace Lucene.Net.Codecs /// /// Create a new writer. The number of items (terms or - /// sub-blocks) per block will aim to be between - /// minItemsPerBlock and maxItemsPerBlock, though in some - /// cases the blocks may be smaller than the min. + /// sub-blocks) per block will aim to be between + /// and , though in some + /// cases the blocks may be smaller than the min. /// public BlockTreeTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter, int minItemsInBlock, int maxItemsInBlock) { @@ -1197,6 +1198,9 @@ namespace Lucene.Net.Codecs internal readonly RAMOutputStream bytesWriter = new RAMOutputStream(); } + /// + /// Disposes all resources used by this object. + /// protected override void Dispose(bool disposing) { if (disposing) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/Codec.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/Codec.cs b/src/Lucene.Net/Codecs/Codec.cs index a9f2448..680e490 100644 --- a/src/Lucene.Net/Codecs/Codec.cs +++ b/src/Lucene.Net/Codecs/Codec.cs @@ -98,7 +98,7 @@ namespace Lucene.Net.Codecs } /// - /// Returns this codec's name + /// Returns this codec's name. public string Name { get @@ -108,46 +108,46 @@ namespace Lucene.Net.Codecs } /// - /// Encodes/decodes postings + /// Encodes/decodes postings. public abstract PostingsFormat PostingsFormat { get; } /// - /// Encodes/decodes docvalues + /// Encodes/decodes docvalues. public abstract DocValuesFormat DocValuesFormat { get; } /// - /// Encodes/decodes stored fields + /// Encodes/decodes stored fields. public abstract StoredFieldsFormat StoredFieldsFormat { get; } /// - /// Encodes/decodes term vectors + /// Encodes/decodes term vectors. public abstract TermVectorsFormat TermVectorsFormat { get; } /// - /// Encodes/decodes field infos file + /// Encodes/decodes field infos file. public abstract FieldInfosFormat FieldInfosFormat { get; } /// - /// Encodes/decodes segment info file + /// Encodes/decodes segment info file. public abstract SegmentInfoFormat SegmentInfoFormat { get; } /// - /// Encodes/decodes document normalization values + /// Encodes/decodes document normalization values. public abstract NormsFormat NormsFormat { get; } /// - /// Encodes/decodes live docs + /// Encodes/decodes live docs. public abstract LiveDocsFormat LiveDocsFormat { get; } /// - /// looks up a codec by name + /// Looks up a codec by name. public static Codec ForName(string name) { return codecFactory.GetCodec(name); } /// - /// returns a list of all available codec names + /// Returns a list of all available codec names. public static ICollection AvailableCodecs() { if (codecFactory is IServiceListable) @@ -166,8 +166,8 @@ namespace Lucene.Net.Codecs private static Codec defaultCodec; /// - /// expert: returns the default codec used for newly created - /// s. + /// Expert: returns the default codec used for newly created + /// s. /// // TODO: should we use this, or maybe a system property is better? public static Codec Default @@ -189,7 +189,7 @@ namespace Lucene.Net.Codecs } /// - /// returns the codec's name. Subclasses can override to provide + /// Returns the codec's name. Subclasses can override to provide /// more detail (such as parameters). /// public override string ToString() http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/CodecUtil.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/CodecUtil.cs b/src/Lucene.Net/Codecs/CodecUtil.cs index 221fd72..a6dd3af 100644 --- a/src/Lucene.Net/Codecs/CodecUtil.cs +++ b/src/Lucene.Net/Codecs/CodecUtil.cs @@ -24,13 +24,12 @@ namespace Lucene.Net.Codecs /// /// Utility class for reading and writing versioned headers. - ///

+ /// /// Writing codec headers is useful to ensure that a file is in /// the format you think it is. - /// + /// /// @lucene.experimental ///

- public sealed class CodecUtil { private CodecUtil() // no instance @@ -49,29 +48,29 @@ namespace Lucene.Net.Codecs /// /// Writes a codec header, which records both a string to - /// identify the file and a version number. this header can + /// identify the file and a version number. This header can /// be parsed and validated with - /// . - ///

+ /// . + /// /// CodecHeader --> Magic,CodecName,Version - ///

    - ///
  • Magic --> . this - /// identifies the start of the header. It is always {@value #CODEC_MAGIC}. - ///
  • CodecName --> . this - /// is a string to identify this file. - ///
  • Version --> . Records - /// the version of the file. - ///
- ///

+ /// + /// Magic --> Uint32 (). this + /// identifies the start of the header. It is always . + /// CodecName --> String (). this + /// is a string to identify this file. + /// Version --> Uint32 (). Records + /// the version of the file. + /// + /// /// Note that the length of a codec header depends only upon the /// name of the codec, so this length can be computed at any time - /// with . + /// with . ///

/// Output stream /// String to identify this file. It should be simple ASCII, /// less than 128 characters in length. /// Version number - /// If there is an I/O error writing to the underlying medium. + /// If there is an I/O error writing to the underlying medium. public static void WriteHeader(DataOutput @out, string codec, int version) { BytesRef bytes = new BytesRef(codec); @@ -88,8 +87,8 @@ namespace Lucene.Net.Codecs /// Computes the length of a codec header. /// /// Codec name. - /// length of the entire codec header. - /// + /// Length of the entire codec header. + /// public static int HeaderLength(string codec) { return 9 + codec.Length; @@ -97,10 +96,10 @@ namespace Lucene.Net.Codecs /// /// Reads and validates a header previously written with - /// . - ///

- /// When reading a file, supply the expected codec and - /// an expected version range (minVersion to maxVersion). + /// . + /// + /// When reading a file, supply the expected and + /// an expected version range ( to ). ///

/// Input stream, positioned at the point where the /// header was previously written. Typically this is located @@ -109,18 +108,18 @@ namespace Lucene.Net.Codecs /// The minimum supported expected version number. /// The maximum supported expected version number. /// The actual version found, when a valid header is found - /// that matches codec, with an actual version - /// where minVersion <= actual <= maxVersion. + /// that matches , with an actual version + /// where minVersion <= actual <= maxVersion. /// Otherwise an exception is thrown. - /// If the first four bytes are not - /// , or if the actual codec found is - /// not codec. - /// If the actual version is less - /// than minVersion. - /// If the actual version is greater - /// than maxVersion. - /// If there is an I/O error reading from the underlying medium. - /// + /// If the first four bytes are not + /// , or if the actual codec found is + /// not . + /// If the actual version is less + /// than . + /// If the actual version is greater + /// than . + /// If there is an I/O error reading from the underlying medium. + /// public static int CheckHeader(DataInput @in, string codec, int minVersion, int maxVersion) { // Safety to guard against reading a bogus string: @@ -133,10 +132,10 @@ namespace Lucene.Net.Codecs } /// - /// Like {@link - /// #checkHeader(DataInput,String,int,int)} except this - /// version assumes the first int has already been read - /// and validated from the input. + /// Like + /// except this + /// version assumes the first has already been read + /// and validated from the input. /// public static int CheckHeaderNoMagic(DataInput @in, string codec, int minVersion, int maxVersion) { @@ -161,24 +160,24 @@ namespace Lucene.Net.Codecs /// /// Writes a codec footer, which records both a checksum - /// algorithm ID and a checksum. this footer can + /// algorithm ID and a checksum. This footer can /// be parsed and validated with - /// . - ///

+ /// . + /// /// CodecFooter --> Magic,AlgorithmID,Checksum - ///

    - ///
  • Magic --> . this - /// identifies the start of the footer. It is always {@value #FOOTER_MAGIC}. - ///
  • AlgorithmID --> . this + /// + /// Magic --> Uint32 (). this + /// identifies the start of the footer. It is always {@value #FOOTER_MAGIC}. + /// AlgorithmID --> Uint32 (). this /// indicates the checksum algorithm used. Currently this is always 0, - /// for zlib-crc32. - ///
  • Checksum --> . The + /// for zlib-crc32. + /// Checksum --> Uint32 (). The /// actual checksum value for all previous bytes in the stream, including - /// the bytes from Magic and AlgorithmID. - ///
+ /// the bytes from Magic and AlgorithmID. + /// ///
/// Output stream - /// If there is an I/O error writing to the underlying medium. + /// If there is an I/O error writing to the underlying medium. public static void WriteFooter(IndexOutput @out) { @out.WriteInt32(FOOTER_MAGIC); @@ -189,18 +188,18 @@ namespace Lucene.Net.Codecs /// /// Computes the length of a codec footer. /// - /// length of the entire codec footer. - /// + /// Length of the entire codec footer. + /// public static int FooterLength() { return 16; } /// - /// Validates the codec footer previously written by . - /// actual checksum value - /// if the footer is invalid, if the checksum does not match, - /// or if {@code in} is not properly positioned before the footer + /// Validates the codec footer previously written by . + /// Actual checksum value. + /// If the footer is invalid, if the checksum does not match, + /// or if is not properly positioned before the footer /// at the end of the stream. public static long CheckFooter(ChecksumIndexInput @in) { @@ -219,9 +218,9 @@ namespace Lucene.Net.Codecs } /// - /// Returns (but does not validate) the checksum previously written by . + /// Returns (but does not validate) the checksum previously written by . /// actual checksum value - /// if the footer is invalid + /// If the footer is invalid. public static long RetrieveChecksum(IndexInput @in) { @in.Seek(@in.Length - FooterLength()); @@ -247,8 +246,7 @@ namespace Lucene.Net.Codecs /// /// Checks that the stream is positioned at the end, and throws exception /// if it is not. - /// @deprecated Use instead, this should only used for files without checksums - [Obsolete("Use CheckFooter() instead")] + [Obsolete("Use CheckFooter(ChecksumIndexInput) instead, this should only used for files without checksums.")] public static void CheckEOF(IndexInput @in) { if (@in.GetFilePointer() != @in.Length) @@ -258,10 +256,10 @@ namespace Lucene.Net.Codecs } /// - /// Clones the provided input, reads all bytes from the file, and calls - ///

+ /// Clones the provided input, reads all bytes from the file, and calls + /// /// Note that this method may be slow, as it must process the entire file. - /// If you just need to extract the checksum value, call . + /// If you just need to extract the checksum value, call . ///

public static long ChecksumEntireFile(IndexInput input) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/DocValuesConsumer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/DocValuesConsumer.cs b/src/Lucene.Net/Codecs/DocValuesConsumer.cs index 999d719..f8b814c 100644 --- a/src/Lucene.Net/Codecs/DocValuesConsumer.cs +++ b/src/Lucene.Net/Codecs/DocValuesConsumer.cs @@ -42,27 +42,28 @@ namespace Lucene.Net.Codecs /// sorted docvalues. Concrete implementations of this /// actually do "something" with the docvalues (write it into /// the index in a specific format). - ///

+ /// /// The lifecycle is: - ///

    - ///
  1. DocValuesConsumer is created by - /// or - /// . - ///
  2. , , - /// or are called for each Numeric, + /// + /// DocValuesConsumer is created by + /// or + /// . + /// , + /// , + /// or are called for each Numeric, /// Binary, or Sorted docvalues field. The API is a "pull" rather /// than "push", and the implementation is free to iterate over the - /// values multiple times (). - ///
  3. After all fields are added, the consumer is d. - ///
- /// + /// values multiple times (). + /// After all fields are added, the consumer is d. + /// + /// /// @lucene.experimental /// public abstract class DocValuesConsumer : IDisposable { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal DocValuesConsumer() { @@ -70,44 +71,44 @@ namespace Lucene.Net.Codecs /// /// Writes numeric docvalues for a field. - /// field information - /// Iterable of numeric values (one for each document). {@code null} indicates + /// Field information. + /// of numeric values (one for each document). null indicates /// a missing value. - /// if an I/O error occurred. + /// If an I/O error occurred. public abstract void AddNumericField(FieldInfo field, IEnumerable values); /// /// Writes binary docvalues for a field. - /// field information - /// Iterable of binary values (one for each document). {@code null} indicates + /// Field information. + /// of binary values (one for each document). null indicates /// a missing value. - /// if an I/O error occurred. + /// If an I/O error occurred. public abstract void AddBinaryField(FieldInfo field, IEnumerable values); /// /// Writes pre-sorted binary docvalues for a field. - /// field information - /// Iterable of binary values in sorted order (deduplicated). - /// Iterable of ordinals (one for each document). {@code -1} indicates + /// Field information. + /// of binary values in sorted order (deduplicated). + /// of ordinals (one for each document). -1 indicates /// a missing value. - /// if an I/O error occurred. + /// If an I/O error occurred. public abstract void AddSortedField(FieldInfo field, IEnumerable values, IEnumerable docToOrd); /// /// Writes pre-sorted set docvalues for a field - /// field information - /// Iterable of binary values in sorted order (deduplicated). - /// Iterable of the number of values for each document. A zero ordinal + /// Field information. + /// of binary values in sorted order (deduplicated). + /// of the number of values for each document. A zero ordinal /// count indicates a missing value. - /// Iterable of ordinal occurrences (docToOrdCount*maxDoc total). - /// if an I/O error occurred. + /// of ordinal occurrences (*maxDoc total). + /// If an I/O error occurred. public abstract void AddSortedSetField(FieldInfo field, IEnumerable values, IEnumerable docToOrdCount, IEnumerable ords); /// - /// Merges the numeric docvalues from toMerge. - ///

- /// The default implementation calls , passing - /// an Iterable that merges and filters deleted documents on the fly.

+ /// Merges the numeric docvalues from . + /// + /// The default implementation calls , passing + /// an that merges and filters deleted documents on the fly. ///
public virtual void MergeNumericField(FieldInfo fieldInfo, MergeState mergeState, IList toMerge, IList docsWithField) { @@ -166,10 +167,10 @@ namespace Lucene.Net.Codecs } /// - /// Merges the binary docvalues from toMerge. - ///

- /// The default implementation calls , passing - /// an Iterable that merges and filters deleted documents on the fly. + /// Merges the binary docvalues from . + /// + /// The default implementation calls , passing + /// an that merges and filters deleted documents on the fly. ///

public virtual void MergeBinaryField(FieldInfo fieldInfo, MergeState mergeState, IList toMerge, IList docsWithField) { @@ -229,10 +230,10 @@ namespace Lucene.Net.Codecs } /// - /// Merges the sorted docvalues from toMerge. - ///

- /// The default implementation calls , passing - /// an Iterable that merges ordinals and values and filters deleted documents.

+ /// Merges the sorted docvalues from . + /// + /// The default implementation calls , passing + /// an that merges ordinals and values and filters deleted documents. ///
public virtual void MergeSortedField(FieldInfo fieldInfo, MergeState mergeState, IList toMerge) { @@ -331,166 +332,11 @@ namespace Lucene.Net.Codecs } } - /* - private class IterableAnonymousInnerClassHelper3 : IEnumerable - { - private readonly DocValuesConsumer OuterInstance; - - private SortedDocValues[] Dvs; - private OrdinalMap Map; - - public IterableAnonymousInnerClassHelper3(DocValuesConsumer outerInstance, SortedDocValues[] dvs, OrdinalMap map) - { - this.OuterInstance = outerInstance; - this.Dvs = dvs; - this.Map = map; - } - - // ord -> value - public virtual IEnumerator GetEnumerator() - { - return new IteratorAnonymousInnerClassHelper3(this); - } - - private class IteratorAnonymousInnerClassHelper3 : IEnumerator - { - private readonly IterableAnonymousInnerClassHelper3 OuterInstance; - - public IteratorAnonymousInnerClassHelper3(IterableAnonymousInnerClassHelper3 outerInstance) - { - this.OuterInstance = outerInstance; - scratch = new BytesRef(); - } - - internal readonly BytesRef scratch; - internal int currentOrd; - - public virtual bool HasNext() - { - return currentOrd < OuterInstance.Map.ValueCount; - } - - public virtual BytesRef Next() - { - if (!HasNext()) - { - throw new Exception(); - } - int segmentNumber = OuterInstance.Map.GetFirstSegmentNumber(currentOrd); - int segmentOrd = (int)OuterInstance.Map.GetFirstSegmentOrd(currentOrd); - OuterInstance.Dvs[segmentNumber].LookupOrd(segmentOrd, scratch); - currentOrd++; - return scratch; - } - - public virtual void Remove() - { - throw new System.NotSupportedException(); - } - } - } - - private class IterableAnonymousInnerClassHelper4 : IEnumerable - { - private readonly DocValuesConsumer OuterInstance; - - private AtomicReader[] Readers; - private SortedDocValues[] Dvs; - private OrdinalMap Map; - - public IterableAnonymousInnerClassHelper4(DocValuesConsumer outerInstance, AtomicReader[] readers, SortedDocValues[] dvs, OrdinalMap map) - { - this.OuterInstance = outerInstance; - this.Readers = readers; - this.Dvs = dvs; - this.Map = map; - } - - public virtual IEnumerator GetEnumerator() - { - return new IteratorAnonymousInnerClassHelper4(this); - } - - private class IteratorAnonymousInnerClassHelper4 : IEnumerator - { - private readonly IterableAnonymousInnerClassHelper4 OuterInstance; - - public IteratorAnonymousInnerClassHelper4(IterableAnonymousInnerClassHelper4 outerInstance) - { - this.OuterInstance = outerInstance; - readerUpto = -1; - } - - internal int readerUpto; - internal int docIDUpto; - internal int nextValue; - internal AtomicReader currentReader; - internal Bits currentLiveDocs; - internal bool nextIsSet; - - public virtual bool HasNext() - { - return nextIsSet || SetNext(); - } - - public virtual void Remove() - { - throw new System.NotSupportedException(); - } - - public virtual Number Next() - { - if (!HasNext()) - { - throw new NoSuchElementException(); - } - Debug.Assert(nextIsSet); - nextIsSet = false; - // TODO make a mutable number - return nextValue; - } - - private bool SetNext() - { - while (true) - { - if (readerUpto == OuterInstance.Readers.Length) - { - return false; - } - - if (currentReader == null || docIDUpto == currentReader.MaxDoc) - { - readerUpto++; - if (readerUpto < OuterInstance.Readers.Length) - { - currentReader = OuterInstance.Readers[readerUpto]; - currentLiveDocs = currentReader.LiveDocs; - } - docIDUpto = 0; - continue; - } - - if (currentLiveDocs == null || currentLiveDocs.get(docIDUpto)) - { - nextIsSet = true; - int segOrd = OuterInstance.Dvs[readerUpto].GetOrd(docIDUpto); - nextValue = segOrd == -1 ? - 1 : (int) OuterInstance.Map.GetGlobalOrd(readerUpto, segOrd); - docIDUpto++; - return true; - } - - docIDUpto++; - } - } - } - }*/ - /// - /// Merges the sortedset docvalues from toMerge. - ///

- /// The default implementation calls , passing - /// an Iterable that merges ordinals and values and filters deleted documents . + /// Merges the sortedset docvalues from . + /// + /// The default implementation calls , passing + /// an that merges ordinals and values and filters deleted documents. ///

public virtual void MergeSortedSetField(FieldInfo fieldInfo, MergeState mergeState, IList toMerge) { @@ -659,283 +505,6 @@ namespace Lucene.Net.Codecs } } - /* - private class IterableAnonymousInnerClassHelper5 : IEnumerable - { - private readonly DocValuesConsumer OuterInstance; - - private SortedSetDocValues[] Dvs; - private OrdinalMap Map; - - public IterableAnonymousInnerClassHelper5(DocValuesConsumer outerInstance, SortedSetDocValues[] dvs, OrdinalMap map) - { - this.OuterInstance = outerInstance; - this.Dvs = dvs; - this.Map = map; - } - - // ord -> value - public virtual IEnumerator GetEnumerator() - { - return new IteratorAnonymousInnerClassHelper5(this); - } - - private class IteratorAnonymousInnerClassHelper5 : IEnumerator - { - private readonly IterableAnonymousInnerClassHelper5 OuterInstance; - - public IteratorAnonymousInnerClassHelper5(IterableAnonymousInnerClassHelper5 outerInstance) - { - this.OuterInstance = outerInstance; - scratch = new BytesRef(); - } - - internal readonly BytesRef scratch; - internal long currentOrd; - - public virtual bool HasNext() - { - return currentOrd < OuterInstance.Map.ValueCount; - } - - public virtual BytesRef Next() - { - if (!HasNext()) - { - throw new Exception(); - } - int segmentNumber = OuterInstance.Map.GetFirstSegmentNumber(currentOrd); - long segmentOrd = OuterInstance.Map.GetFirstSegmentOrd(currentOrd); - OuterInstance.Dvs[segmentNumber].LookupOrd(segmentOrd, scratch); - currentOrd++; - return scratch; - } - - public virtual void Remove() - { - throw new System.NotSupportedException(); - } - } - } - - private class IterableAnonymousInnerClassHelper6 : IEnumerable - { - private readonly DocValuesConsumer OuterInstance; - - private AtomicReader[] Readers; - private SortedSetDocValues[] Dvs; - - public IterableAnonymousInnerClassHelper6(DocValuesConsumer outerInstance, AtomicReader[] readers, SortedSetDocValues[] dvs) - { - this.OuterInstance = outerInstance; - this.Readers = readers; - this.Dvs = dvs; - } - - public virtual IEnumerator GetEnumerator() - { - return new IteratorAnonymousInnerClassHelper6(this); - } - - private class IteratorAnonymousInnerClassHelper6 : IEnumerator - { - private readonly IterableAnonymousInnerClassHelper6 OuterInstance; - - public IteratorAnonymousInnerClassHelper6(IterableAnonymousInnerClassHelper6 outerInstance) - { - this.OuterInstance = outerInstance; - readerUpto = -1; - } - - internal int readerUpto; - internal int docIDUpto; - internal int nextValue; - internal AtomicReader currentReader; - internal Bits currentLiveDocs; - internal bool nextIsSet; - - public virtual bool HasNext() - { - return nextIsSet || SetNext(); - } - - public virtual void Remove() - { - throw new System.NotSupportedException(); - } - - public virtual Number Next() - { - if (!HasNext()) - { - throw new Exception(); - } - Debug.Assert(nextIsSet); - nextIsSet = false; - // TODO make a mutable number - return nextValue; - } - - private bool SetNext() - { - while (true) - { - if (readerUpto == OuterInstance.Readers.Length) - { - return false; - } - - if (currentReader == null || docIDUpto == currentReader.MaxDoc) - { - readerUpto++; - if (readerUpto < OuterInstance.Readers.Length) - { - currentReader = OuterInstance.Readers[readerUpto]; - currentLiveDocs = currentReader.LiveDocs; - } - docIDUpto = 0; - continue; - } - - if (currentLiveDocs == null || currentLiveDocs.Get(docIDUpto)) - { - nextIsSet = true; - SortedSetDocValues dv = OuterInstance.Dvs[readerUpto]; - dv.Document = docIDUpto; - nextValue = 0; - while (dv.NextOrd() != SortedSetDocValues.NO_MORE_ORDS) - { - nextValue++; - } - docIDUpto++; - return true; - } - - docIDUpto++; - } - } - } - } - - private class IterableAnonymousInnerClassHelper7 : IEnumerable - { - private readonly DocValuesConsumer OuterInstance; - - private AtomicReader[] Readers; - private SortedSetDocValues[] Dvs; - private OrdinalMap Map; - - public IterableAnonymousInnerClassHelper7(DocValuesConsumer outerInstance, AtomicReader[] readers, SortedSetDocValues[] dvs, OrdinalMap map) - { - this.OuterInstance = outerInstance; - this.Readers = readers; - this.Dvs = dvs; - this.Map = map; - } - - public virtual IEnumerator GetEnumerator() - { - return new IteratorAnonymousInnerClassHelper7(this); - } - - private class IteratorAnonymousInnerClassHelper7 : IEnumerator - { - private readonly IterableAnonymousInnerClassHelper7 OuterInstance; - - public IteratorAnonymousInnerClassHelper7(IterableAnonymousInnerClassHelper7 outerInstance) - { - this.OuterInstance = outerInstance; - readerUpto = -1; - ords = new long[8]; - } - - internal int readerUpto; - internal int docIDUpto; - internal long nextValue; - internal AtomicReader currentReader; - internal Bits currentLiveDocs; - internal bool nextIsSet; - internal long[] ords; - internal int ordUpto; - internal int ordLength; - - public virtual bool HasNext() - { - return nextIsSet || SetNext(); - } - - public virtual void Remove() - { - throw new System.NotSupportedException(); - } - - public virtual Number Next() - { - if (!HasNext()) - { - throw new Exception(); - } - Debug.Assert(nextIsSet); - nextIsSet = false; - // TODO make a mutable number - return nextValue; - } - - private bool SetNext() - { - while (true) - { - if (readerUpto == OuterInstance.Readers.Length) - { - return false; - } - - if (ordUpto < ordLength) - { - nextValue = ords[ordUpto]; - ordUpto++; - nextIsSet = true; - return true; - } - - if (currentReader == null || docIDUpto == currentReader.MaxDoc) - { - readerUpto++; - if (readerUpto < OuterInstance.Readers.Length) - { - currentReader = OuterInstance.Readers[readerUpto]; - currentLiveDocs = currentReader.LiveDocs; - } - docIDUpto = 0; - continue; - } - - if (currentLiveDocs == null || currentLiveDocs.Get(docIDUpto)) - { - Debug.Assert(docIDUpto < currentReader.MaxDoc); - SortedSetDocValues dv = OuterInstance.Dvs[readerUpto]; - dv.Document = docIDUpto; - ordUpto = ordLength = 0; - long ord; - while ((ord = dv.NextOrd()) != SortedSetDocValues.NO_MORE_ORDS) - { - if (ordLength == ords.Length) - { - ords = ArrayUtil.Grow(ords, ordLength + 1); - } - ords[ordLength] = OuterInstance.Map.GetGlobalOrd(readerUpto, ord); - ordLength++; - } - docIDUpto++; - continue; - } - - docIDUpto++; - } - } - } - }*/ - // TODO: seek-by-ord to nextSetBit internal class BitsFilteredTermsEnum : FilteredTermsEnum { @@ -954,12 +523,18 @@ namespace Lucene.Net.Codecs } } + /// + /// Disposes all resources used by this object. + /// public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } + /// + /// Implementations must override and should dispose all resources used by this instance. + /// protected abstract void Dispose(bool disposing); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/DocValuesFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/DocValuesFormat.cs b/src/Lucene.Net/Codecs/DocValuesFormat.cs index 9ef0f4d..907aed9 100644 --- a/src/Lucene.Net/Codecs/DocValuesFormat.cs +++ b/src/Lucene.Net/Codecs/DocValuesFormat.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.Codecs /// Note, when extending this class, the name () may /// written into the index in certain configurations. In order for the segment /// to be read, the name must resolve to your implementation via . - /// this method uses to resolve format names. + /// This method uses to resolve format names. /// /// To implement your own format: /// @@ -123,8 +123,8 @@ namespace Lucene.Net.Codecs /// NOTE: by the time this call returns, it must hold open any files it will /// need to use; else, those files may be deleted. Additionally, required files /// may be deleted during the execution of this call before there is a chance - /// to open them. Under these circumstances an IOException should be thrown by - /// the implementation. IOExceptions are expected and will automatically cause + /// to open them. Under these circumstances an should be thrown by + /// the implementation. s are expected and will automatically cause /// a retry of the segment opening logic with the newly revised segments. /// public abstract DocValuesProducer FieldsProducer(SegmentReadState state); @@ -147,14 +147,14 @@ namespace Lucene.Net.Codecs } /// - /// looks up a format by name + /// Looks up a format by name. public static DocValuesFormat ForName(string name) { return docValuesFormatFactory.GetDocValuesFormat(name); } /// - /// returns a list of all available format names + /// Returns a list of all available format names. public static ICollection AvailableDocValuesFormats() { if (docValuesFormatFactory is IServiceListable) http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/DocValuesProducer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/DocValuesProducer.cs b/src/Lucene.Net/Codecs/DocValuesProducer.cs index c5f2605..900d1b3 100644 --- a/src/Lucene.Net/Codecs/DocValuesProducer.cs +++ b/src/Lucene.Net/Codecs/DocValuesProducer.cs @@ -29,74 +29,81 @@ namespace Lucene.Net.Codecs /// /// Abstract API that produces numeric, binary and /// sorted docvalues. - /// + /// /// @lucene.experimental /// public abstract class DocValuesProducer : IDisposable { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal DocValuesProducer() { } /// - /// Returns for this field. - /// The returned instance need not be thread-safe: it will only be - /// used by a single thread. + /// Returns for this field. + /// The returned instance need not be thread-safe: it will only be + /// used by a single thread. /// public abstract NumericDocValues GetNumeric(FieldInfo field); /// - /// Returns for this field. - /// The returned instance need not be thread-safe: it will only be - /// used by a single thread. + /// Returns for this field. + /// The returned instance need not be thread-safe: it will only be + /// used by a single thread. /// public abstract BinaryDocValues GetBinary(FieldInfo field); /// - /// Returns for this field. - /// The returned instance need not be thread-safe: it will only be - /// used by a single thread. + /// Returns for this field. + /// The returned instance need not be thread-safe: it will only be + /// used by a single thread. /// public abstract SortedDocValues GetSorted(FieldInfo field); /// - /// Returns for this field. - /// The returned instance need not be thread-safe: it will only be - /// used by a single thread. + /// Returns for this field. + /// The returned instance need not be thread-safe: it will only be + /// used by a single thread. /// public abstract SortedSetDocValues GetSortedSet(FieldInfo field); /// - /// Returns a at the size of reader.maxDoc(), - /// with turned on bits for each docid that does have a value for this field. - /// The returned instance need not be thread-safe: it will only be - /// used by a single thread. + /// Returns a at the size of reader.MaxDoc, + /// with turned on bits for each docid that does have a value for this field. + /// The returned instance need not be thread-safe: it will only be + /// used by a single thread. /// public abstract IBits GetDocsWithField(FieldInfo field); /// - /// Returns approximate RAM bytes used + /// Returns approximate RAM bytes used. public abstract long RamBytesUsed(); /// - /// Checks consistency of this producer - ///

+ /// Checks consistency of this producer. + /// /// Note that this may be costly in terms of I/O, e.g. /// may involve computing a checksum value against large data files. + /// /// @lucene.internal ///

public abstract void CheckIntegrity(); + /// + /// Disposes all resources used by this object. + /// public virtual void Dispose() { Dispose(true); GC.SuppressFinalize(this); } + /// + /// Implementations must override and should dispose all resources used by this instance. + /// protected abstract void Dispose(bool disposing); } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/FieldInfosFormat.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/FieldInfosFormat.cs b/src/Lucene.Net/Codecs/FieldInfosFormat.cs index a9f932c..30215f2 100644 --- a/src/Lucene.Net/Codecs/FieldInfosFormat.cs +++ b/src/Lucene.Net/Codecs/FieldInfosFormat.cs @@ -20,28 +20,29 @@ namespace Lucene.Net.Codecs using FieldInfos = Lucene.Net.Index.FieldInfos; // javadocs /// - /// Encodes/decodes + /// Encodes/decodes . + /// /// @lucene.experimental /// public abstract class FieldInfosFormat { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal FieldInfosFormat() { } /// - /// Returns a to read field infos - /// from the index + /// Returns a to read field infos + /// from the index. /// public abstract FieldInfosReader FieldInfosReader { get; } /// - /// Returns a to write field infos - /// to the index + /// Returns a to write field infos + /// to the index. /// public abstract FieldInfosWriter FieldInfosWriter { get; } } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/FieldInfosReader.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/FieldInfosReader.cs b/src/Lucene.Net/Codecs/FieldInfosReader.cs index 3e86d1b..8014e33 100644 --- a/src/Lucene.Net/Codecs/FieldInfosReader.cs +++ b/src/Lucene.Net/Codecs/FieldInfosReader.cs @@ -22,22 +22,23 @@ namespace Lucene.Net.Codecs using IOContext = Lucene.Net.Store.IOContext; /// - /// Codec API for reading . + /// Codec API for reading . + /// /// @lucene.experimental /// public abstract class FieldInfosReader { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal FieldInfosReader() { } /// - /// Read the previously written with {@link - /// FieldInfosWriter}. + /// Read the previously written with + /// . /// public abstract FieldInfos Read(Directory directory, string segmentName, string segmentSuffix, IOContext iocontext); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/FieldInfosWriter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/FieldInfosWriter.cs b/src/Lucene.Net/Codecs/FieldInfosWriter.cs index cd06e29..92bfe07 100644 --- a/src/Lucene.Net/Codecs/FieldInfosWriter.cs +++ b/src/Lucene.Net/Codecs/FieldInfosWriter.cs @@ -22,22 +22,23 @@ namespace Lucene.Net.Codecs using IOContext = Lucene.Net.Store.IOContext; /// - /// Codec API for writing . + /// Codec API for writing . + /// /// @lucene.experimental /// public abstract class FieldInfosWriter { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal FieldInfosWriter() { } /// - /// Writes the provided to the - /// directory. + /// Writes the provided to the + /// directory. /// public abstract void Write(Directory directory, string segmentName, string segmentSuffix, FieldInfos infos, IOContext context); } http://git-wip-us.apache.org/repos/asf/lucenenet/blob/a08ae945/src/Lucene.Net/Codecs/FieldsConsumer.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net/Codecs/FieldsConsumer.cs b/src/Lucene.Net/Codecs/FieldsConsumer.cs index ee6d7cd..8c29e2e 100644 --- a/src/Lucene.Net/Codecs/FieldsConsumer.cs +++ b/src/Lucene.Net/Codecs/FieldsConsumer.cs @@ -32,30 +32,30 @@ namespace Lucene.Net.Codecs /// payloads postings. Concrete implementations of this /// actually do "something" with the postings (write it into /// the index in a specific format). - ///

+ /// /// The lifecycle is: - ///

    - ///
  1. FieldsConsumer is created by - /// . - ///
  2. For each field, is called, - /// returning a for the field. - ///
  3. After all fields are added, the consumer is d. - ///
- /// + /// + /// FieldsConsumer is created by + /// . + /// For each field, is called, + /// returning a for the field. + /// After all fields are added, the consumer is d. + /// + /// /// @lucene.experimental /// public abstract class FieldsConsumer : IDisposable { /// /// Sole constructor. (For invocation by subclass - /// constructors, typically implicit.) + /// constructors, typically implicit.) /// protected internal FieldsConsumer() { } /// - /// Add a new field + /// Add a new field. public abstract TermsConsumer AddField(FieldInfo field); /// @@ -68,15 +68,16 @@ namespace Lucene.Net.Codecs } /// - /// Called when we are done adding everything. + /// Implementations must override and should dispose all resources used by this instance. + /// protected abstract void Dispose(bool disposing); /// - /// Called during merging to merge all from - /// sub-readers. this must recurse to merge all postings - /// (terms, docs, positions, etc.). A {@link - /// PostingsFormat} can override this default - /// implementation to do its own merging. + /// Called during merging to merge all from + /// sub-readers. this must recurse to merge all postings + /// (terms, docs, positions, etc.). A + /// can override this default + /// implementation to do its own merging. /// public virtual void Merge(MergeState mergeState, Fields fields) {