lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnas...@apache.org
Subject [1/2] git commit: Clean up Appending, Bloom and DiskDV code
Date Sun, 14 Sep 2014 23:28:09 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 17db2acd2 -> 6e900565d


Clean up Appending, Bloom and DiskDV code


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/02f232e7
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/02f232e7
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/02f232e7

Branch: refs/heads/master
Commit: 02f232e79a11cbcaf59f4519c373f2cf7f266e26
Parents: 17db2ac
Author: Prescott Nasser <pnasser@apache.org>
Authored: Sun Sep 14 15:48:19 2014 -0700
Committer: Prescott Nasser <pnasser@apache.org>
Committed: Sun Sep 14 15:48:19 2014 -0700

----------------------------------------------------------------------
 .../Appending/AppendingCodec.cs                 |   2 +-
 .../Appending/AppendingPostingsFormat.cs        |  33 +--
 .../Appending/AppendingTermsReader.cs           |   4 +-
 .../Bloom/BloomFilterFactory.cs                 |   2 +-
 .../Bloom/BloomFilteringPostingsFormat.cs       | 273 +++++++++---------
 .../Bloom/DefaultBloomFilterFactory.cs          |   2 +-
 src/Lucene.Net.Codecs/Bloom/FuzzySet.cs         | 280 +++++++++----------
 src/Lucene.Net.Codecs/Bloom/HashFunction.cs     |   2 +-
 src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs      |   9 +-
 .../DiskDV/DiskDocValuesFormat.cs               |   6 +-
 .../DiskDV/DiskDocValuesProducer.cs             |   8 +-
 src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs |   6 +-
 12 files changed, 290 insertions(+), 337 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs b/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
index 01248d6..0fc3589 100644
--- a/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
+++ b/src/Lucene.Net.Codecs/Appending/AppendingCodec.cs
@@ -18,7 +18,7 @@
 namespace Lucene.Net.Codecs.Appending
 {
     using System;
-    using Lucene.Net.Codecs.Lucene40;
+    using Lucene40;
 
     /// <summary>
     /// This codec uses an index format that is very similar to Lucene40Codec 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs b/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
index 8e3f770..ff427dc 100644
--- a/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Appending/AppendingPostingsFormat.cs
@@ -18,8 +18,8 @@
 namespace Lucene.Net.Codecs.Appending
 {
     using System;
-    using Lucene.Net.Codecs.Lucene40;
-    using Lucene.Net.Index;
+    using Lucene40;
+    using Index;
 
     /// <summary>
     /// Appending Postigns Implementation
@@ -38,26 +38,21 @@ namespace Lucene.Net.Codecs.Appending
 
         public override FieldsProducer FieldsProducer(SegmentReadState state)
         {
-            PostingsReaderBase postings = new Lucene40PostingsReader(state.Directory, state.FieldInfos,
+            using (var postings = new Lucene40PostingsReader(state.Directory, state.FieldInfos,
                 state.SegmentInfo,
-                state.Context, state.SegmentSuffix);
-
-            var success = false;
-            FieldsProducer ret;
-            using (ret = new AppendingTermsReader(
-                state.Directory,
-                state.FieldInfos,
-                state.SegmentInfo,
-                postings,
-                state.Context,
-                state.SegmentSuffix,
-                state.TermsIndexDivisor))
+                state.Context, state.SegmentSuffix))
             {
-                success = true;
+                var ret = new AppendingTermsReader(
+                    state.Directory,
+                    state.FieldInfos,
+                    state.SegmentInfo,
+                    postings,
+                    state.Context,
+                    state.SegmentSuffix,
+                    state.TermsIndexDivisor);
+
+                return ret;
             }
-
-            return ret;
-            
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs b/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
index da4e33f..b309f5d 100644
--- a/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
+++ b/src/Lucene.Net.Codecs/Appending/AppendingTermsReader.cs
@@ -18,8 +18,8 @@
 namespace Lucene.Net.Codecs.Appending
 {
     using System;
-    using Lucene.Net.Index;
-    using Lucene.Net.Store;
+    using Index;
+    using Store;
 
     /// <summary>
     /// Reads append-only terms from AppendingTermsWriter.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/BloomFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/BloomFilterFactory.cs b/src/Lucene.Net.Codecs/Bloom/BloomFilterFactory.cs
index 6bac454..d443f6e 100644
--- a/src/Lucene.Net.Codecs/Bloom/BloomFilterFactory.cs
+++ b/src/Lucene.Net.Codecs/Bloom/BloomFilterFactory.cs
@@ -18,7 +18,7 @@
 namespace Lucene.Net.Codecs.Bloom
 {
 
-    using Lucene.Net.Index;
+    using Index;
 
     /// <summary>
     /// Class used to create index-time {@link FuzzySet} appropriately configured for

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs b/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
index eb710b8..5cd2f21 100644
--- a/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Bloom/BloomFilteringPostingsFormat.cs
@@ -15,18 +15,19 @@
  * limitations under the License.
  */
 
+using System.Linq;
+
 namespace Lucene.Net.Codecs.Bloom
 {
 
     using System;
     using System.Collections.Generic;
     using System.Diagnostics;
-    using Lucene.Net.Index;
-    using Lucene.Net.Search;
-    using Lucene.Net.Store;
-    using Lucene.Net.Support;
-    using Lucene.Net.Util;
-    using Lucene.Net.Util.Automaton;
+    using Index;
+    using Store;
+    using Support;
+    using Util;
+    using Util.Automaton;
 
     /// <summary>
     /// 
@@ -66,10 +67,10 @@ namespace Lucene.Net.Codecs.Bloom
         public static readonly int VERSION_CURRENT = VERSION_CHECKSUM;
 
         /** Extension of Bloom Filters file */
-        private static readonly String BLOOM_EXTENSION = "blm";
+        private const String BLOOM_EXTENSION = "blm";
 
-        private BloomFilterFactory bloomFilterFactory = new DefaultBloomFilterFactory();
-        private PostingsFormat delegatePostingsFormat;
+        private readonly BloomFilterFactory _bloomFilterFactory = new DefaultBloomFilterFactory();
+        private readonly PostingsFormat _delegatePostingsFormat;
         
         /// <summary>
         ///  Creates Bloom filters for a selection of fields created in the index. This
@@ -82,8 +83,8 @@ namespace Lucene.Net.Codecs.Bloom
         public BloomFilteringPostingsFormat(PostingsFormat delegatePostingsFormat,
             BloomFilterFactory bloomFilterFactory) : base(BLOOM_CODEC_NAME)
         {
-            this.delegatePostingsFormat = delegatePostingsFormat;
-            this.bloomFilterFactory = bloomFilterFactory;
+            _delegatePostingsFormat = delegatePostingsFormat;
+            _bloomFilterFactory = bloomFilterFactory;
         }
 
         /// <summary>
@@ -110,13 +111,12 @@ namespace Lucene.Net.Codecs.Bloom
 
         public override FieldsConsumer FieldsConsumer(SegmentWriteState state)
         {
-            if (delegatePostingsFormat == null)
+            if (_delegatePostingsFormat == null)
             {
                 throw new InvalidOperationException("Error - constructed without a choice of PostingsFormat");
             }
             return new BloomFilteredFieldsConsumer(
-                delegatePostingsFormat.FieldsConsumer(state), state,
-                delegatePostingsFormat);
+                _delegatePostingsFormat.FieldsConsumer(state), state, this);
         }
 
         public override FieldsProducer FieldsProducer(SegmentReadState state)
@@ -126,36 +126,36 @@ namespace Lucene.Net.Codecs.Bloom
 
         internal class BloomFilteredFieldsProducer : FieldsProducer
         {
-            private FieldsProducer delegateFieldsProducer;
-            private HashMap<String, FuzzySet> bloomsByFieldName = new HashMap<String, FuzzySet>();
+            private readonly FieldsProducer _delegateFieldsProducer;
+            private readonly HashMap<String, FuzzySet> _bloomsByFieldName = new HashMap<String, FuzzySet>();
 
             public BloomFilteredFieldsProducer(SegmentReadState state)
             {
 
-                String bloomFileName = IndexFileNames.SegmentFileName(
+                var bloomFileName = IndexFileNames.SegmentFileName(
                     state.SegmentInfo.Name, state.SegmentSuffix, BLOOM_EXTENSION);
                 ChecksumIndexInput bloomIn = null;
-                bool success = false;
+                var success = false;
                 try
                 {
                     bloomIn = state.Directory.OpenChecksumInput(bloomFileName, state.Context);
-                    int version = CodecUtil.CheckHeader(bloomIn, BLOOM_CODEC_NAME, VERSION_START, VERSION_CURRENT);
-                    // // Load the hash function used in the BloomFilter
+                    var version = CodecUtil.CheckHeader(bloomIn, BLOOM_CODEC_NAME, VERSION_START, VERSION_CURRENT);
+                    // Load the hash function used in the BloomFilter
                     // hashFunction = HashFunction.forName(bloomIn.readString());
                     // Load the delegate postings format
-                    PostingsFormat delegatePostingsFormat = PostingsFormat.ForName(bloomIn
-                        .ReadString());
+                    var delegatePostingsFormat = ForName(bloomIn.ReadString());
 
-                    this.delegateFieldsProducer = delegatePostingsFormat
+                    _delegateFieldsProducer = delegatePostingsFormat
                         .FieldsProducer(state);
-                    int numBlooms = bloomIn.ReadInt();
-                    for (int i = 0; i < numBlooms; i++)
+                    var numBlooms = bloomIn.ReadInt();
+                    for (var i = 0; i < numBlooms; i++)
                     {
-                        int fieldNum = bloomIn.ReadInt();
-                        FuzzySet bloom = FuzzySet.Deserialize(bloomIn);
-                        FieldInfo fieldInfo = state.FieldInfos.FieldInfo(fieldNum);
-                        bloomsByFieldName.Add(fieldInfo.Name, bloom);
+                        var fieldNum = bloomIn.ReadInt();
+                        var bloom = FuzzySet.Deserialize(bloomIn);
+                        var fieldInfo = state.FieldInfos.FieldInfo(fieldNum);
+                        _bloomsByFieldName.Add(fieldInfo.Name, bloom);
                     }
+                    
                     if (version >= VERSION_CHECKSUM)
                     {
                         CodecUtil.CheckFooter(bloomIn);
@@ -164,6 +164,7 @@ namespace Lucene.Net.Codecs.Bloom
                     {
                         CodecUtil.CheckEOF(bloomIn);
                     }
+                    
                     IOUtils.Close(bloomIn);
                     success = true;
                 }
@@ -171,53 +172,46 @@ namespace Lucene.Net.Codecs.Bloom
                 {
                     if (!success)
                     {
-                        IOUtils.CloseWhileHandlingException(bloomIn, delegateFieldsProducer);
+                        IOUtils.CloseWhileHandlingException(bloomIn, _delegateFieldsProducer);
                     }
                 }
             }
 
             public override IEnumerator<string> GetEnumerator()
             {
-                return delegateFieldsProducer.GetEnumerator();
+                return _delegateFieldsProducer.GetEnumerator();
             }
 
             public override Terms Terms(String field)
             {
-                FuzzySet filter = bloomsByFieldName[field];
+                var filter = _bloomsByFieldName[field];
                 if (filter == null)
-                {
-                    return delegateFieldsProducer.Terms(field);
-                }
-                else
-                {
-                    Terms result = delegateFieldsProducer.Terms(field);
-                    if (result == null)
-                    {
-                        return null;
-                    }
-                    return new BloomFilteredTerms(result, filter);
-                }
+                    return _delegateFieldsProducer.Terms(field);
+                
+                var result = _delegateFieldsProducer.Terms(field);
+                return result == null ? null : new BloomFilteredTerms(result, filter);
             }
 
             public override int Size()
             {
-                return delegateFieldsProducer.Size();
+                return _delegateFieldsProducer.Size();
             }
 
+            [Obsolete("iterate fields and add their size() instead.")]
             public override long UniqueTermCount
             {
-                get { return delegateFieldsProducer.UniqueTermCount; }
+                get { return _delegateFieldsProducer.UniqueTermCount; }
             }
 
             public override void Dispose()
             {
-                delegateFieldsProducer.Dispose();
+                _delegateFieldsProducer.Dispose();
             }
 
             public override long RamBytesUsed()
             {
-                long sizeInBytes = ((delegateFieldsProducer != null) ? delegateFieldsProducer.RamBytesUsed() : 0);
-                foreach (var entry in bloomsByFieldName.EntrySet())
+                var sizeInBytes = ((_delegateFieldsProducer != null) ? _delegateFieldsProducer.RamBytesUsed() : 0);
+                foreach (var entry in _bloomsByFieldName.EntrySet())
                 {
                     sizeInBytes += entry.Key.Length*RamUsageEstimator.NUM_BYTES_CHAR;
                     sizeInBytes += entry.Value.RamBytesUsed();
@@ -227,123 +221,117 @@ namespace Lucene.Net.Codecs.Bloom
 
             public override void CheckIntegrity()
             {
-                delegateFieldsProducer.CheckIntegrity();
+                _delegateFieldsProducer.CheckIntegrity();
             }
 
             internal class BloomFilteredTerms : Terms
             {
-                private Terms delegateTerms;
-                private FuzzySet filter;
+                private readonly Terms _delegateTerms;
+                private readonly FuzzySet _filter;
 
                 public BloomFilteredTerms(Terms terms, FuzzySet filter)
                 {
-                    this.delegateTerms = terms;
-                    this.filter = filter;
+                    _delegateTerms = terms;
+                    _filter = filter;
                 }
 
                 public override TermsEnum Intersect(CompiledAutomaton compiled,
                     BytesRef startTerm)
                 {
-                    return delegateTerms.Intersect(compiled, startTerm);
+                    return _delegateTerms.Intersect(compiled, startTerm);
                 }
 
                 public override TermsEnum Iterator(TermsEnum reuse)
                 {
-                    if ((reuse != null) && (reuse is BloomFilteredTermsEnum))
-                    {
-                        // recycle the existing BloomFilteredTermsEnum by asking the delegate
-                        // to recycle its contained TermsEnum
-                        BloomFilteredTermsEnum bfte = (BloomFilteredTermsEnum) reuse;
-                        if (bfte.filter == filter)
-                        {
-                            bfte.Reset(delegateTerms, bfte.delegateTermsEnum);
-                            return bfte;
-                        }
-                    }
+                    if (!(reuse is BloomFilteredTermsEnum))
+                        return new BloomFilteredTermsEnum(_delegateTerms, reuse, _filter);
+
+                    // recycle the existing BloomFilteredTermsEnum by asking the delegate
+                    // to recycle its contained TermsEnum
+                    var bfte = (BloomFilteredTermsEnum) reuse;
+
                     // We have been handed something we cannot reuse (either null, wrong
                     // class or wrong filter) so allocate a new object
-                    return new BloomFilteredTermsEnum(delegateTerms, reuse, filter);
+                    if (bfte.FILTER != _filter) return new BloomFilteredTermsEnum(_delegateTerms, reuse, _filter);
+                    bfte.Reset(_delegateTerms, bfte.DELEGATE_TERMS_ENUM);
+                    return bfte;
+                    
                 }
 
                 public override IComparer<BytesRef> Comparator
                 {
-                    get { return delegateTerms.Comparator; }
+                    get { return _delegateTerms.Comparator; }
                 }
 
                 public override long Size()
                 {
-                    return delegateTerms.Size();
+                    return _delegateTerms.Size();
                 }
 
                 public override long SumTotalTermFreq
                 {
-                    get { return delegateTerms.SumTotalTermFreq; }
+                    get { return _delegateTerms.SumTotalTermFreq; }
                 }
 
                 public override long SumDocFreq
                 {
-                    get { return delegateTerms.SumDocFreq; }
+                    get { return _delegateTerms.SumDocFreq; }
                 }
 
                 public override int DocCount
                 {
-                    get { return delegateTerms.DocCount; }
+                    get { return _delegateTerms.DocCount; }
                 }
 
                 public override bool HasFreqs()
                 {
-                    return delegateTerms.HasFreqs();
+                    return _delegateTerms.HasFreqs();
                 }
 
                 public override bool HasOffsets()
                 {
-                    return delegateTerms.HasOffsets();
+                    return _delegateTerms.HasOffsets();
                 }
 
                 public override bool HasPositions()
                 {
-                    return delegateTerms.HasPositions();
+                    return _delegateTerms.HasPositions();
                 }
 
                 public override bool HasPayloads()
                 {
-                    return delegateTerms.HasPayloads();
+                    return _delegateTerms.HasPayloads();
                 }
             }
 
             internal sealed class BloomFilteredTermsEnum : TermsEnum
             {
-                private Terms delegateTerms;
-                internal TermsEnum delegateTermsEnum;
-                private TermsEnum reuseDelegate;
-                internal readonly FuzzySet filter;
+                private Terms _delegateTerms;
+                internal TermsEnum DELEGATE_TERMS_ENUM;
+                private TermsEnum _reuseDelegate;
+                internal readonly FuzzySet FILTER;
 
                 public BloomFilteredTermsEnum(Terms delegateTerms, TermsEnum reuseDelegate, FuzzySet filter)
                 {
-                    this.delegateTerms = delegateTerms;
-                    this.reuseDelegate = reuseDelegate;
-                    this.filter = filter;
+                    _delegateTerms = delegateTerms;
+                    _reuseDelegate = reuseDelegate;
+                    FILTER = filter;
                 }
 
                 internal void Reset(Terms delegateTerms, TermsEnum reuseDelegate)
                 {
-                    this.delegateTerms = delegateTerms;
-                    this.reuseDelegate = reuseDelegate;
-                    this.delegateTermsEnum = null;
+                    _delegateTerms = delegateTerms;
+                    _reuseDelegate = reuseDelegate;
+                    DELEGATE_TERMS_ENUM = null;
                 }
 
                 private TermsEnum Delegate()
                 {
-                    if (delegateTermsEnum == null)
-                    {
-                        /* pull the iterator only if we really need it -
-                    * this can be a relativly heavy operation depending on the 
-                    * delegate postings format and they underlying directory
-                    * (clone IndexInput) */
-                        delegateTermsEnum = delegateTerms.Iterator(reuseDelegate);
-                    }
-
-                    return delegateTermsEnum;
+                    // pull the iterator only if we really need it -
+                    // this can be a relativly heavy operation depending on the 
+                    // delegate postings format and they underlying directory
+                    // (clone IndexInput)
+                    return DELEGATE_TERMS_ENUM ?? (DELEGATE_TERMS_ENUM = _delegateTerms.Iterator(_reuseDelegate));
                 }
 
                 public override BytesRef Next()
@@ -353,7 +341,7 @@ namespace Lucene.Net.Codecs.Bloom
 
                 public override IComparer<BytesRef> Comparator
                 {
-                    get { return delegateTerms.Comparator; }
+                    get { return _delegateTerms.Comparator; }
                 }
 
                 public override bool SeekExact(BytesRef text)
@@ -363,7 +351,7 @@ namespace Lucene.Net.Codecs.Bloom
                     // structure
                     // that may occasionally give a false positive but guaranteed no false
                     // negatives
-                    if (filter.Contains(text) == FuzzySet.ContainsResult.No)
+                    if (FILTER.Contains(text) == FuzzySet.ContainsResult.No)
                     {
                         return false;
                     }
@@ -416,66 +404,58 @@ namespace Lucene.Net.Codecs.Bloom
 
         internal class BloomFilteredFieldsConsumer : FieldsConsumer
         {
-            private FieldsConsumer delegateFieldsConsumer;
-            private Dictionary<FieldInfo, FuzzySet> bloomFilters = new Dictionary<FieldInfo, FuzzySet>();
-            private SegmentWriteState state;
+            private readonly FieldsConsumer _delegateFieldsConsumer;
+            private readonly Dictionary<FieldInfo, FuzzySet> _bloomFilters = new Dictionary<FieldInfo, FuzzySet>();
+            private readonly SegmentWriteState _state;
+            private readonly BloomFilteringPostingsFormat _bfpf;
 
             public BloomFilteredFieldsConsumer(FieldsConsumer fieldsConsumer,
-                SegmentWriteState state, PostingsFormat delegatePostingsFormat)
+                SegmentWriteState state, BloomFilteringPostingsFormat bfpf)
             {
-                this.delegateFieldsConsumer = fieldsConsumer;
-                this.state = state;
+                _delegateFieldsConsumer = fieldsConsumer;
+                _state = state;
+                _bfpf = bfpf;
             }
 
             public override TermsConsumer AddField(FieldInfo field)
             {
-                FuzzySet bloomFilter = bloomFilterFactory.GetSetForField(state, field);
+                var bloomFilter = _bfpf._bloomFilterFactory.GetSetForField(_state, field);
                 if (bloomFilter != null)
                 {
-                    Debug.Debug.Assert((bloomFilters.ContainsKey(field) == false);
-                    bloomFilters.Add(field, bloomFilter);
-                    return new WrappedTermsConsumer(delegateFieldsConsumer.AddField(field), bloomFilter);
-                }
-                else
-                {
-                    // No, use the unfiltered fieldsConsumer - we are not interested in
-                    // recording any term Bitsets.
-                    return delegateFieldsConsumer.AddField(field);
+                    Debug.Assert((_bloomFilters.ContainsKey(field) == false));
+
+                    _bloomFilters.Add(field, bloomFilter);
+                    return new WrappedTermsConsumer(_delegateFieldsConsumer.AddField(field), bloomFilter);
                 }
+
+                // No, use the unfiltered fieldsConsumer - we are not interested in
+                // recording any term Bitsets.
+                return _delegateFieldsConsumer.AddField(field);
             }
 
             public override void Dispose()
             {
-                delegateFieldsConsumer.Dispose();
+                _delegateFieldsConsumer.Dispose();
                 // Now we are done accumulating values for these fields
-                var nonSaturatedBlooms = new List<KeyValuePair<FieldInfo, FuzzySet>>();
+                var nonSaturatedBlooms = (from entry in _bloomFilters.EntrySet() let bloomFilter = entry.Value where !_bfpf._bloomFilterFactory.IsSaturated(bloomFilter, entry.Key) select entry).ToList();
 
-                foreach (var entry in bloomFilters.EntrySet())
-                {
-                    FuzzySet bloomFilter = entry.Value;
-                    if (!bloomFilterFactory.IsSaturated(bloomFilter, entry.Key))
-                    {
-                        nonSaturatedBlooms.Add(entry);
-                    }
-                }
-
-                String bloomFileName = IndexFileNames.SegmentFileName(
-                    state.SegmentInfo.Name, state.SegmentSuffix, BLOOM_EXTENSION);
+                var bloomFileName = IndexFileNames.SegmentFileName(
+                    _state.SegmentInfo.Name, _state.SegmentSuffix, BLOOM_EXTENSION);
                 IndexOutput bloomOutput = null;
 
                 try
                 {
-                    bloomOutput = state.Directory.CreateOutput(bloomFileName, state.Context);
+                    bloomOutput = _state.Directory.CreateOutput(bloomFileName, _state.Context);
                     CodecUtil.WriteHeader(bloomOutput, BLOOM_CODEC_NAME, VERSION_CURRENT);
                     // remember the name of the postings format we will delegate to
-                    bloomOutput.WriteString(delegatePostingsFormat.Name);
+                    bloomOutput.WriteString(_bfpf._delegatePostingsFormat.Name);
 
                     // First field in the output file is the number of fields+blooms saved
                     bloomOutput.WriteInt(nonSaturatedBlooms.Count);
                     foreach (var entry in nonSaturatedBlooms)
                     {
-                        FieldInfo fieldInfo = entry.Key;
-                        FuzzySet bloomFilter = entry.Value;
+                        var fieldInfo = entry.Key;
+                        var bloomFilter = entry.Value;
                         bloomOutput.WriteInt(fieldInfo.Number);
                         SaveAppropriatelySizedBloomFilter(bloomOutput, bloomFilter, fieldInfo);
                     }
@@ -487,19 +467,16 @@ namespace Lucene.Net.Codecs.Bloom
                     IOUtils.Close(bloomOutput);
                 }
                 //We are done with large bitsets so no need to keep them hanging around
-                bloomFilters.Clear();
+                _bloomFilters.Clear();
             }
 
-            private void SaveAppropriatelySizedBloomFilter(IndexOutput bloomOutput,
+            private void SaveAppropriatelySizedBloomFilter(DataOutput bloomOutput,
                 FuzzySet bloomFilter, FieldInfo fieldInfo)
             {
 
-                FuzzySet rightSizedSet = bloomFilterFactory.Downsize(fieldInfo,
-                    bloomFilter);
-                if (rightSizedSet == null)
-                {
-                    rightSizedSet = bloomFilter;
-                }
+                var rightSizedSet = _bfpf._bloomFilterFactory.Downsize(fieldInfo,
+                    bloomFilter) ?? bloomFilter;
+
                 rightSizedSet.Serialize(bloomOutput);
             }
 
@@ -507,18 +484,18 @@ namespace Lucene.Net.Codecs.Bloom
 
         internal class WrappedTermsConsumer : TermsConsumer
         {
-            private TermsConsumer delegateTermsConsumer;
-            private FuzzySet bloomFilter;
+            private readonly TermsConsumer _delegateTermsConsumer;
+            private readonly FuzzySet _bloomFilter;
 
             public WrappedTermsConsumer(TermsConsumer termsConsumer, FuzzySet bloomFilter)
             {
-                this.delegateTermsConsumer = termsConsumer;
-                this.bloomFilter = bloomFilter;
+                _delegateTermsConsumer = termsConsumer;
+                _bloomFilter = bloomFilter;
             }
 
             public override PostingsConsumer StartTerm(BytesRef text)
             {
-                return delegateTermsConsumer.StartTerm(text);
+                return _delegateTermsConsumer.StartTerm(text);
             }
 
             public override void FinishTerm(BytesRef text, TermStats stats)
@@ -526,19 +503,19 @@ namespace Lucene.Net.Codecs.Bloom
                 // Record this term in our BloomFilter
                 if (stats.DocFreq > 0)
                 {
-                    bloomFilter.AddValue(text);
+                    _bloomFilter.AddValue(text);
                 }
-                delegateTermsConsumer.FinishTerm(text, stats);
+                _delegateTermsConsumer.FinishTerm(text, stats);
             }
 
             public override void Finish(long sumTotalTermFreq, long sumDocFreq, int docCount)
             {
-                delegateTermsConsumer.Finish(sumTotalTermFreq, sumDocFreq, docCount);
+                _delegateTermsConsumer.Finish(sumTotalTermFreq, sumDocFreq, docCount);
             }
 
             public override IComparer<BytesRef> Comparator
             {
-                get { return delegateTermsConsumer.Comparator; }
+                get { return _delegateTermsConsumer.Comparator; }
             }
 
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/DefaultBloomFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/DefaultBloomFilterFactory.cs b/src/Lucene.Net.Codecs/Bloom/DefaultBloomFilterFactory.cs
index 6d1bb54..3e49add 100644
--- a/src/Lucene.Net.Codecs/Bloom/DefaultBloomFilterFactory.cs
+++ b/src/Lucene.Net.Codecs/Bloom/DefaultBloomFilterFactory.cs
@@ -17,7 +17,7 @@
 
 namespace Lucene.Net.Codecs.Bloom
 {
-    using Lucene.Net.Index;
+    using Index;
 
     /// <summary>
     /// Default policy is to allocate a bitset with 10% saturation given a unique term per document.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs b/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
index 5a97564..aa0a036 100644
--- a/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
+++ b/src/Lucene.Net.Codecs/Bloom/FuzzySet.cs
@@ -20,8 +20,9 @@ namespace Lucene.Net.Codecs.Bloom
 
     using System;
     using System.Diagnostics;
-    using Lucene.Net.Store;
-    using Lucene.Net.Util;
+    using System.Linq;
+    using Store;
+    using Util;
 
     /// <summary>
     /// A class used to represent a set of many, potentially large, values (e.g. many
@@ -49,18 +50,16 @@ namespace Lucene.Net.Codecs.Bloom
         public static readonly int VERSION_START = VERSION_SPI;
         public static readonly int VERSION_CURRENT = 2;
 
-        public static HashFunction hashFunctionForVersion(int version)
+        public static HashFunction HashFunctionForVersion(int version)
         {
             if (version < VERSION_START)
-            {
                 throw new ArgumentException("Version " + version + " is too old, expected at least " +
                                                    VERSION_START);
-            }
-            else if (version > VERSION_CURRENT)
-            {
+            
+            if (version > VERSION_CURRENT)
                 throw new ArgumentException("Version " + version + " is too new, expected at most " +
                                                    VERSION_CURRENT);
-            }
+            
             return MurmurHash2.INSTANCE;
         }
 
@@ -75,9 +74,9 @@ namespace Lucene.Net.Codecs.Bloom
             No
         };
 
-        private readonly HashFunction hashFunction;
-        private readonly FixedBitSet filter;
-        private readonly int bloomSize;
+        private readonly HashFunction _hashFunction;
+        private readonly FixedBitSet _filter;
+        private readonly int _bloomSize;
 
         //The sizes of BitSet used are all numbers that, when expressed in binary form,
         //are all ones. This is to enable fast downsizing from one bitset to another
@@ -86,92 +85,94 @@ namespace Lucene.Net.Codecs.Bloom
         // a large bitset and then mapped to a smaller set can be looked up using a single
         // AND operation of the query term's hash rather than needing to perform a 2-step
         // translation of the query term that mirrors the stored content's reprojections.
-        private static int[] usableBitSetSizes;
+        private static int[] _usableBitSetSizes;
 
-        private static 
+        private static int[] UsableBitSetSizes
         {
-            usableBitSetSizes = new int[30];
-            int mask = 1;
-            int size = mask;
-            for (int i = 0; i < usableBitSetSizes.Length; i++)
+            get
             {
-                size = (size << 1) | mask;
-                usableBitSetSizes[i] = size;
+                if (_usableBitSetSizes == null)
+                    InitializeUsableBitSetSizes();
+
+                return _usableBitSetSizes;
             }
+            set { _usableBitSetSizes = value; }
         }
 
-        /**
-   * Rounds down required maxNumberOfBits to the nearest number that is made up
-   * of all ones as a binary number.  
-   * Use this method where controlling memory use is paramount.
-   */
+        private static void InitializeUsableBitSetSizes()
+        {
+            UsableBitSetSizes = new int[30];
+            const int mask = 1;
+            var size = mask;
+            for (var i = 0; i < UsableBitSetSizes.Length; i++)
+            {
+                size = (size << 1) | mask;
+                UsableBitSetSizes[i] = size;
+            }
+        }
 
+        /// <summary>
+        /// Rounds down required maxNumberOfBits to the nearest number that is made up
+        /// of all ones as a binary number.  
+        /// Use this method where controlling memory use is paramount.
+        /// </summary>
         public static int GetNearestSetSize(int maxNumberOfBits)
         {
-            int result = usableBitSetSizes[0];
-            for (int i = 0; i < usableBitSetSizes.Length; i++)
+            var result = UsableBitSetSizes[0];
+            foreach (var t in UsableBitSetSizes.Where(t => t <= maxNumberOfBits))
             {
-                if (usableBitSetSizes[i] <= maxNumberOfBits)
-                {
-                    result = usableBitSetSizes[i];
-                }
+                result = t;
             }
             return result;
         }
 
-        /**
-   * Use this method to choose a set size where accuracy (low content saturation) is more important
-   * than deciding how much memory to throw at the problem.
-   * @param desiredSaturation A number between 0 and 1 expressing the % of bits set once all values have been recorded
-   * @return The size of the set nearest to the required size
-   */
-
+        /// <summary>
+        /// Use this method to choose a set size where accuracy (low content saturation) is more important
+        /// than deciding how much memory to throw at the problem.
+        /// </summary>
+        /// <param name="maxNumberOfValuesExpected"></param>
+        /// <param name="desiredSaturation">A number between 0 and 1 expressing the % of bits set once all values have been recorded</param>
+        /// <returns>The size of the set nearest to the required size</returns>
         public static int GetNearestSetSize(int maxNumberOfValuesExpected,
             float desiredSaturation)
         {
             // Iterate around the various scales of bitset from smallest to largest looking for the first that
             // satisfies value volumes at the chosen saturation level
-            for (int i = 0; i < usableBitSetSizes.Length; i++)
+            foreach (var t in from t in UsableBitSetSizes let numSetBitsAtDesiredSaturation = (int) (t*desiredSaturation) let estimatedNumUniqueValues = GetEstimatedNumberUniqueValuesAllowingForCollisions(
+                t, numSetBitsAtDesiredSaturation) where estimatedNumUniqueValues > maxNumberOfValuesExpected select t)
             {
-                int numSetBitsAtDesiredSaturation = (int) (usableBitSetSizes[i]*desiredSaturation);
-                int estimatedNumUniqueValues = GetEstimatedNumberUniqueValuesAllowingForCollisions(
-                    usableBitSetSizes[i], numSetBitsAtDesiredSaturation);
-                if (estimatedNumUniqueValues > maxNumberOfValuesExpected)
-                {
-                    return usableBitSetSizes[i];
-                }
+                return t;
             }
             return -1;
         }
 
         public static FuzzySet CreateSetBasedOnMaxMemory(int maxNumBytes)
         {
-            int setSize = GetNearestSetSize(maxNumBytes);
-            return new FuzzySet(new FixedBitSet(setSize + 1), setSize, hashFunctionForVersion(VERSION_CURRENT));
+            var setSize = GetNearestSetSize(maxNumBytes);
+            return new FuzzySet(new FixedBitSet(setSize + 1), setSize, HashFunctionForVersion(VERSION_CURRENT));
         }
 
         public static FuzzySet CreateSetBasedOnQuality(int maxNumUniqueValues, float desiredMaxSaturation)
         {
-            int setSize = GetNearestSetSize(maxNumUniqueValues, desiredMaxSaturation);
-            return new FuzzySet(new FixedBitSet(setSize + 1), setSize, hashFunctionForVersion(VERSION_CURRENT));
+            var setSize = GetNearestSetSize(maxNumUniqueValues, desiredMaxSaturation);
+            return new FuzzySet(new FixedBitSet(setSize + 1), setSize, HashFunctionForVersion(VERSION_CURRENT));
         }
 
         private FuzzySet(FixedBitSet filter, int bloomSize, HashFunction hashFunction)
         {
-            this.filter = filter;
-            this.bloomSize = bloomSize;
-            this.hashFunction = hashFunction;
+            _filter = filter;
+            _bloomSize = bloomSize;
+            _hashFunction = hashFunction;
         }
 
-        /**
-   * The main method required for a Bloom filter which, given a value determines set membership.
-   * Unlike a conventional set, the fuzzy set returns NO or MAYBE rather than true or false.
-   * @return NO or MAYBE
-   */
-
+        /// <summary>
+        /// The main method required for a Bloom filter which, given a value determines set membership.
+        /// Unlike a conventional set, the fuzzy set returns NO or MAYBE rather than true or false.
+        /// </summary>
+        /// <returns>NO or MAYBE</returns>
         public ContainsResult Contains(BytesRef value)
         {
-            int hash = hashFunction.Hash(value);
+            var hash = _hashFunction.Hash(value);
             if (hash < 0)
             {
                 hash = hash*-1;
@@ -179,147 +180,128 @@ namespace Lucene.Net.Codecs.Bloom
             return MayContainValue(hash);
         }
 
-        /**
-   * Serializes the data set to file using the following format:
-   * <ul>
-   *  <li>FuzzySet --&gt;FuzzySetVersion,HashFunctionName,BloomSize,
-   * NumBitSetWords,BitSetWord<sup>NumBitSetWords</sup></li> 
-   * <li>HashFunctionName --&gt; {@link DataOutput#writeString(String) String} The
-   * name of a ServiceProvider registered {@link HashFunction}</li>
-   * <li>FuzzySetVersion --&gt; {@link DataOutput#writeInt Uint32} The version number of the {@link FuzzySet} class</li>
-   * <li>BloomSize --&gt; {@link DataOutput#writeInt Uint32} The modulo value used
-   * to project hashes into the field's Bitset</li>
-   * <li>NumBitSetWords --&gt; {@link DataOutput#writeInt Uint32} The number of
-   * longs (as returned from {@link FixedBitSet#getBits})</li>
-   * <li>BitSetWord --&gt; {@link DataOutput#writeLong Long} A long from the array
-   * returned by {@link FixedBitSet#getBits}</li>
-   * </ul>
-   * @param out Data output stream
-   * @ If there is a low-level I/O error
-   */
-
+        /// <summary>
+        ///  Serializes the data set to file using the following format:
+        ///  <ul>
+        ///   <li>FuzzySet --&gt;FuzzySetVersion,HashFunctionName,BloomSize,
+        ///  NumBitSetWords,BitSetWord<sup>NumBitSetWords</sup></li> 
+        ///  <li>HashFunctionName --&gt; {@link DataOutput#writeString(String) String} The
+        ///  name of a ServiceProvider registered {@link HashFunction}</li>
+        ///  <li>FuzzySetVersion --&gt; {@link DataOutput#writeInt Uint32} The version number of the {@link FuzzySet} class</li>
+        ///  <li>BloomSize --&gt; {@link DataOutput#writeInt Uint32} The modulo value used
+        ///  to project hashes into the field's Bitset</li>
+        ///  <li>NumBitSetWords --&gt; {@link DataOutput#writeInt Uint32} The number of
+        ///  longs (as returned from {@link FixedBitSet#getBits})</li>
+        ///  <li>BitSetWord --&gt; {@link DataOutput#writeLong Long} A long from the array
+        ///  returned by {@link FixedBitSet#getBits}</li>
+        ///  </ul>
+        ///  @param out Data output stream
+        ///  @ If there is a low-level I/O error
+        /// </summary>
         public void Serialize(DataOutput output)
         {
             output.WriteInt(VERSION_CURRENT);
-            output.WriteInt(bloomSize);
-            long[] bits = filter.GetBits();
+            output.WriteInt(_bloomSize);
+            var bits = _filter.Bits;
             output.WriteInt(bits.Length);
-            for (int i = 0; i < bits.Length; i++)
+            foreach (var t in bits)
             {
                 // Can't used VLong encoding because cant cope with negative numbers
                 // output by FixedBitSet
-                output.WriteLong(bits[i]);
+                output.WriteLong(t);
             }
         }
 
         public static FuzzySet Deserialize(DataInput input)
         {
-            int version = input.ReadInt();
+            var version = input.ReadInt();
             if (version == VERSION_SPI)
-            {
                 input.ReadString();
-            }
-            HashFunction hashFunction = hashFunctionForVersion(version);
-            int bloomSize = input.ReadInt();
-            int numLongs = input.ReadInt();
-            long[] longs = new long[numLongs];
-            for (int i = 0; i < numLongs; i++)
+           
+            var hashFunction = HashFunctionForVersion(version);
+            var bloomSize = input.ReadInt();
+            var numLongs = input.ReadInt();
+            var longs = new long[numLongs];
+            for (var i = 0; i < numLongs; i++)
             {
                 longs[i] = input.ReadLong();
             }
-            FixedBitSet bits = new FixedBitSet(longs, bloomSize + 1);
+            var bits = new FixedBitSet(longs, bloomSize + 1);
             return new FuzzySet(bits, bloomSize, hashFunction);
         }
 
         private ContainsResult MayContainValue(int positiveHash)
         {
-            Debug.Debug.Assert((positiveHash >= 0);
+            Debug.Assert((positiveHash >= 0));
 
             // Bloom sizes are always base 2 and so can be ANDed for a fast modulo
-            int pos = positiveHash & bloomSize;
-            if (filter.Get(pos))
-            {
-                // This term may be recorded in this index (but could be a collision)
-                return ContainsResult.Maybe;
-            }
-            // definitely NOT in this segment
-            return ContainsResult.No;
+            var pos = positiveHash & _bloomSize;
+            return _filter.Get(pos) ? ContainsResult.Maybe : ContainsResult.No;
         }
 
-        /**
-   * Records a value in the set. The referenced bytes are hashed and then modulo n'd where n is the
-   * chosen size of the internal bitset.
-   * @param value the key value to be hashed
-   * @ If there is a low-level I/O error
-   */
-
+        /// <summary>
+        /// Records a value in the set. The referenced bytes are hashed and then modulo n'd where n is the
+        /// chosen size of the internal bitset.
+        /// </summary>
+        /// <param name="value">The Key value to be hashed</param>
         public void AddValue(BytesRef value)
         {
-            int hash = hashFunction.Hash(value);
+            var hash = _hashFunction.Hash(value);
             if (hash < 0)
             {
                 hash = hash*-1;
             }
             // Bitmasking using bloomSize is effectively a modulo operation.
-            int bloomPos = hash & bloomSize;
-            filter.Set(bloomPos);
+            var bloomPos = hash & _bloomSize;
+            _filter.Set(bloomPos);
         }
 
-
-        /**
-   * 
-   * @param targetMaxSaturation A number between 0 and 1 describing the % of bits that would ideally be set in the 
-   * result. Lower values have better accuracy but require more space.
-   * @return a smaller FuzzySet or null if the current set is already over-saturated
-   */
-
+        /// <param name="targetMaxSaturation">
+        /// A number between 0 and 1 describing the % of bits that would ideally be set in the result. 
+        /// Lower values have better accuracy but require more space.
+        /// </param>
+        /// <return>A smaller FuzzySet or null if the current set is already over-saturated</return>
         public FuzzySet Downsize(float targetMaxSaturation)
         {
-            int numBitsSet = filter.Cardinality();
-            FixedBitSet rightSizedBitSet = filter;
-            int rightSizedBitSetSize = bloomSize;
+            var numBitsSet = _filter.Cardinality();
+            FixedBitSet rightSizedBitSet;
+            var rightSizedBitSetSize = _bloomSize;
             //Hopefully find a smaller size bitset into which we can project accumulated values while maintaining desired saturation level
-            for (int i = 0; i < usableBitSetSizes.Length; i++)
+            foreach (var candidateBitsetSize in from candidateBitsetSize in UsableBitSetSizes let candidateSaturation = numBitsSet
+                                                                                                                         /(float) candidateBitsetSize where candidateSaturation <= targetMaxSaturation select candidateBitsetSize)
             {
-                int candidateBitsetSize = usableBitSetSizes[i];
-                float candidateSaturation = (float) numBitsSet
-                                            /(float) candidateBitsetSize;
-                if (candidateSaturation <= targetMaxSaturation)
-                {
-                    rightSizedBitSetSize = candidateBitsetSize;
-                    break;
-                }
+                rightSizedBitSetSize = candidateBitsetSize;
+                break;
             }
             // Re-project the numbers to a smaller space if necessary
-            if (rightSizedBitSetSize < bloomSize)
+            if (rightSizedBitSetSize < _bloomSize)
             {
                 // Reset the choice of bitset to the smaller version
                 rightSizedBitSet = new FixedBitSet(rightSizedBitSetSize + 1);
                 // Map across the bits from the large set to the smaller one
-                int bitIndex = 0;
+                var bitIndex = 0;
                 do
                 {
-                    bitIndex = filter.NextSetBit(bitIndex);
-                    if (bitIndex >= 0)
-                    {
-                        // Project the larger number into a smaller one effectively
-                        // modulo-ing by using the target bitset size as a mask
-                        int downSizedBitIndex = bitIndex & rightSizedBitSetSize;
-                        rightSizedBitSet.Set(downSizedBitIndex);
-                        bitIndex++;
-                    }
-                } while ((bitIndex >= 0) && (bitIndex <= bloomSize));
+                    bitIndex = _filter.NextSetBit(bitIndex);
+                    if (bitIndex < 0) continue;
+
+                    // Project the larger number into a smaller one effectively
+                    // modulo-ing by using the target bitset size as a mask
+                    var downSizedBitIndex = bitIndex & rightSizedBitSetSize;
+                    rightSizedBitSet.Set(downSizedBitIndex);
+                    bitIndex++;
+                } while ((bitIndex >= 0) && (bitIndex <= _bloomSize));
             }
             else
             {
                 return null;
             }
-            return new FuzzySet(rightSizedBitSet, rightSizedBitSetSize, hashFunction);
+            return new FuzzySet(rightSizedBitSet, rightSizedBitSetSize, _hashFunction);
         }
 
         public int GetEstimatedUniqueValues()
         {
-            return GetEstimatedNumberUniqueValuesAllowingForCollisions(bloomSize, filter.Cardinality());
+            return GetEstimatedNumberUniqueValuesAllowingForCollisions(_bloomSize, _filter.Cardinality());
         }
 
         // Given a set size and a the number of set bits, produces an estimate of the number of unique values recorded
@@ -328,20 +310,20 @@ namespace Lucene.Net.Codecs.Bloom
         {
             double setSizeAsDouble = setSize;
             double numRecordedBitsAsDouble = numRecordedBits;
-            double saturation = numRecordedBitsAsDouble/setSizeAsDouble;
-            double logInverseSaturation = Math.Log(1 - saturation)*-1;
+            var saturation = numRecordedBitsAsDouble/setSizeAsDouble;
+            var logInverseSaturation = Math.Log(1 - saturation)*-1;
             return (int) (setSizeAsDouble*logInverseSaturation);
         }
 
         public float GetSaturation()
         {
-            int numBitsSet = filter.Cardinality();
-            return (float) numBitsSet/(float) bloomSize;
+            var numBitsSet = _filter.Cardinality();
+            return numBitsSet/(float) _bloomSize;
         }
 
         public long RamBytesUsed()
         {
-            return RamUsageEstimator.SizeOf(filter.GetBits());
+            return RamUsageEstimator.SizeOf(_filter.GetBits());
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/HashFunction.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/HashFunction.cs b/src/Lucene.Net.Codecs/Bloom/HashFunction.cs
index 9431e1b..af1a608 100644
--- a/src/Lucene.Net.Codecs/Bloom/HashFunction.cs
+++ b/src/Lucene.Net.Codecs/Bloom/HashFunction.cs
@@ -17,7 +17,7 @@
 
 namespace Lucene.Net.Codecs.Bloom
 {
-    using Lucene.Net.Util;
+    using Util;
 
     /// <summary>
     /// Base class for hashing functions that can be referred to by name.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs b/src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs
index cb70d5d..2054a5e 100644
--- a/src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs
+++ b/src/Lucene.Net.Codecs/Bloom/MurmurHash2.cs
@@ -15,12 +15,11 @@
  * limitations under the License.
  */
 
-using System;
-
 namespace Lucene.Net.Codecs.Bloom
 {
 
-    using Lucene.Net.Util;
+    using System;
+    using Util;
 
     /// <summary>
     /// This is a very fast, non-cryptographic hash suitable for general hash-based
@@ -66,8 +65,8 @@ namespace Lucene.Net.Codecs.Bloom
                 h *= m;
                 h ^= k;
             }
-            int len_m = len_4 << 2;
-            int left = len - len_m;
+            var len_m = len_4 << 2;
+            var left = len - len_m;
             if (left != 0)
             {
                 if (left >= 3)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
index c71295c..75dd484 100644
--- a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
+++ b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesFormat.cs
@@ -18,9 +18,9 @@
 
 namespace Lucene.Net.Codecs.DiskDV
 {
-    using Lucene.Net.Codecs;
-    using Lucene.Net.Codecs.Lucene45;
-    using Lucene.Net.Index;
+    using Codecs;
+    using Lucene45;
+    using Index;
     using System;
 
     /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesProducer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesProducer.cs b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesProducer.cs
index a5241be..95d58ee 100644
--- a/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesProducer.cs
+++ b/src/Lucene.Net.Codecs/DiskDV/DiskDocValuesProducer.cs
@@ -18,10 +18,10 @@
 namespace Lucene.Net.Codecs.DiskDV
 {
     using System;
-    using Lucene.Net.Codecs.Lucene45;
-    using Lucene.Net.Index;
-    using Lucene.Net.Store;
-    using Lucene.Net.Util.Packed;
+    using Lucene45;
+    using Index;
+    using Store;
+    using Util.Packed;
 
     public class DiskDocValuesProducer : Lucene45DocValuesProducer
     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/02f232e7/src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs b/src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs
index 91dd77b..cb688c2 100644
--- a/src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs
+++ b/src/Lucene.Net.Codecs/DiskDV/DiskNormsFormat.cs
@@ -19,9 +19,9 @@ namespace Lucene.Net.Codecs.DiskDV
 {
 
     using System;
-    using Lucene.Net.Codecs;
-    using Lucene.Net.Codecs.Lucene45;
-    using Lucene.Net.Index;
+    using Codecs;
+    using Lucene45;
+    using Index;
 
     /// <summary>
     /// Norms format that keeps all norms on disk


Mime
View raw message