lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [29/37] lucenenet git commit: Lucene.Net.Codecs: Renamed private fields camelCase
Date Sun, 29 Jan 2017 13:27:51 GMT
Lucene.Net.Codecs: Renamed private fields camelCase


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

Branch: refs/heads/api-work
Commit: f46d37290304f5f3e4393c1e40601846fcdfe3cc
Parents: fcb9891
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Jan 29 17:29:46 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Jan 29 17:29:46 2017 +0700

----------------------------------------------------------------------
 .../BlockTerms/BlockTermsWriter.cs              | 26 +++---
 .../BlockTerms/FixedGapTermsIndexReader.cs      | 10 +-
 .../BlockTerms/FixedGapTermsIndexWriter.cs      | 98 ++++++++++----------
 .../BlockTerms/VariableGapTermsIndexReader.cs   | 14 +--
 4 files changed, 74 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f46d3729/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
index 17d0b30..d7d94ce 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs
@@ -49,10 +49,10 @@ namespace Lucene.Net.Codecs.BlockTerms
         public const string TERMS_EXTENSION = "tib";
 
         protected IndexOutput _output;
-        private readonly PostingsWriterBase PostingsWriter;
-        private readonly FieldInfos FieldInfos;
-        private FieldInfo CurrentField;
-        private readonly TermsIndexWriterBase _termsIndexWriter;
+        private readonly PostingsWriterBase postingsWriter;
+        private readonly FieldInfos fieldInfos;
+        private FieldInfo currentField;
+        private readonly TermsIndexWriterBase termsIndexWriter;
         
         protected class FieldMetaData
         {
@@ -86,16 +86,16 @@ namespace Lucene.Net.Codecs.BlockTerms
         {
             var termsFileName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name, state.SegmentSuffix,
                 TERMS_EXTENSION);
-            _termsIndexWriter = termsIndexWriter;
+            this.termsIndexWriter = termsIndexWriter;
             _output = state.Directory.CreateOutput(termsFileName, state.Context);
             var success = false;
 
             try
             {
-                FieldInfos = state.FieldInfos;
+                fieldInfos = state.FieldInfos;
                 WriteHeader(_output);
-                CurrentField = null;
-                PostingsWriter = postingsWriter;
+                currentField = null;
+                this.postingsWriter = postingsWriter;
 
                 postingsWriter.Init(_output); // have consumer write its format/header
                 success = true;
@@ -116,11 +116,11 @@ namespace Lucene.Net.Codecs.BlockTerms
 
         public override TermsConsumer AddField(FieldInfo field)
         {
-            Debug.Assert(CurrentField == null || CurrentField.Name.CompareTo(field.Name)
< 0);
+            Debug.Assert(currentField == null || currentField.Name.CompareTo(field.Name)
< 0);
 
-            CurrentField = field;
-            var fiw = _termsIndexWriter.AddField(field, _output.FilePointer);
-            return new TermsWriter(this, fiw, field, PostingsWriter);
+            currentField = field;
+            var fiw = termsIndexWriter.AddField(field, _output.FilePointer);
+            return new TermsWriter(this, fiw, field, postingsWriter);
         }
 
         public override void Dispose()
@@ -155,7 +155,7 @@ namespace Lucene.Net.Codecs.BlockTerms
             }
             finally
             {
-                IOUtils.Close(_output, PostingsWriter, _termsIndexWriter);
+                IOUtils.Close(_output, postingsWriter, termsIndexWriter);
                 _output = null;
             }
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f46d3729/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
index 7a1750d..8fa852f 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
@@ -301,7 +301,7 @@ namespace Lucene.Net.Codecs.BlockTerms
         {
             private readonly FixedGapTermsIndexReader outerInstance;
 
-            internal volatile CoreFieldIndex CoreIndex;
+            internal volatile CoreFieldIndex coreIndex;
 
             private readonly long _indexStart;
             private readonly long _termsStart;
@@ -326,8 +326,8 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             private void LoadTermsIndex()
             {
-                if (CoreIndex == null)
-                    CoreIndex = new CoreFieldIndex(_indexStart, _termsStart, _packedIndexStart,
_packedOffsetsStart,
+                if (coreIndex == null)
+                    coreIndex = new CoreFieldIndex(_indexStart, _termsStart, _packedIndexStart,
_packedOffsetsStart,
                         _numIndexTerms, outerInstance);
             }
 
@@ -485,7 +485,7 @@ namespace Lucene.Net.Codecs.BlockTerms
         public override FieldIndexEnum GetFieldEnum(FieldInfo fieldInfo)
         {
             FieldIndexData fieldData = _fields[fieldInfo];
-            return fieldData.CoreIndex == null ? null : new IndexEnum(fieldData.CoreIndex,
this);
+            return fieldData.coreIndex == null ? null : new IndexEnum(fieldData.coreIndex,
this);
         }
 
         public override void Dispose()
@@ -519,7 +519,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                                 ((_termBytesReader != null) ? _termBytesReader.RamBytesUsed()
: 0);
 
             return _fields.Values.Aggregate(sizeInBytes,
-                (current, entry) => (current + entry.CoreIndex.RamBytesUsed()));
+                (current, entry) => (current + entry.coreIndex.RamBytesUsed()));
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f46d3729/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
index 74ba41d..038e42c 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs
@@ -115,115 +115,115 @@ namespace Lucene.Net.Codecs.BlockTerms
         {
             private readonly FixedGapTermsIndexWriter outerInstance;
 
-            internal readonly FieldInfo FieldInfo;
-            internal int NumIndexTerms;
-            internal readonly long IndexStart;
-            internal readonly long TermsStart;
-            internal long PackedIndexStart;
-            internal long PackedOffsetsStart;
-            private long _numTerms;
+            internal readonly FieldInfo fieldInfo;
+            internal int numIndexTerms;
+            internal readonly long indexStart;
+            internal readonly long termsStart;
+            internal long packedIndexStart;
+            internal long packedOffsetsStart;
+            private long numTerms;
 
             // TODO: we could conceivably make a PackedInts wrapper
             // that auto-grows... then we wouldn't force 6 bytes RAM
             // per index term:
-            private short[] _termLengths;
-            private int[] _termsPointerDeltas;
-            private long _lastTermsPointer;
-            private long _totTermLength;
+            private short[] termLengths;
+            private int[] termsPointerDeltas;
+            private long lastTermsPointer;
+            private long totTermLength;
 
-            private readonly BytesRef _lastTerm = new BytesRef();
+            private readonly BytesRef lastTerm = new BytesRef();
 
             internal SimpleFieldWriter(FixedGapTermsIndexWriter outerInstance, FieldInfo
fieldInfo, long termsFilePointer)
             {
                 this.outerInstance = outerInstance;
-                FieldInfo = fieldInfo;
-                IndexStart = outerInstance.Output.FilePointer;
-                TermsStart = _lastTermsPointer = termsFilePointer;
-                _termLengths = new short[0];
-                _termsPointerDeltas = new int[0];
+                this.fieldInfo = fieldInfo;
+                indexStart = outerInstance.Output.FilePointer;
+                termsStart = lastTermsPointer = termsFilePointer;
+                termLengths = new short[0];
+                termsPointerDeltas = new int[0];
             }
 
             public override bool CheckIndexTerm(BytesRef text, TermStats stats)
             {
                 // First term is first indexed term:
                 //System.output.println("FGW: checkIndexTerm text=" + text.utf8ToString());
-                if (0 == (_numTerms++ % outerInstance._termIndexInterval))
+                if (0 == (numTerms++ % outerInstance._termIndexInterval))
                     return true;
 
                 // save last term just before next index term so we
                 // can compute wasted suffix
-                if (0 == _numTerms % outerInstance._termIndexInterval)
-                    _lastTerm.CopyBytes(text);
+                if (0 == numTerms % outerInstance._termIndexInterval)
+                    lastTerm.CopyBytes(text);
 
                 return false;
             }
 
             public override void Add(BytesRef text, TermStats stats, long termsFilePointer)
             {
-                int indexedTermLength = outerInstance.IndexedTermPrefixLength(_lastTerm,
text);
+                int indexedTermLength = outerInstance.IndexedTermPrefixLength(lastTerm, text);
 
                 // write only the min prefix that shows the diff
                 // against prior term
                 outerInstance.Output.WriteBytes(text.Bytes, text.Offset, indexedTermLength);
 
-                if (_termLengths.Length == NumIndexTerms)
+                if (termLengths.Length == numIndexTerms)
                 {
-                    _termLengths = ArrayUtil.Grow(_termLengths);
+                    termLengths = ArrayUtil.Grow(termLengths);
                 }
-                if (_termsPointerDeltas.Length == NumIndexTerms)
+                if (termsPointerDeltas.Length == numIndexTerms)
                 {
-                    _termsPointerDeltas = ArrayUtil.Grow(_termsPointerDeltas);
+                    termsPointerDeltas = ArrayUtil.Grow(termsPointerDeltas);
                 }
 
                 // save delta terms pointer
-                _termsPointerDeltas[NumIndexTerms] = (int)(termsFilePointer - _lastTermsPointer);
-                _lastTermsPointer = termsFilePointer;
+                termsPointerDeltas[numIndexTerms] = (int)(termsFilePointer - lastTermsPointer);
+                lastTermsPointer = termsFilePointer;
 
                 // save term length (in bytes)
                 Debug.Assert(indexedTermLength <= short.MaxValue);
-                _termLengths[NumIndexTerms] = (short)indexedTermLength;
-                _totTermLength += indexedTermLength;
+                termLengths[numIndexTerms] = (short)indexedTermLength;
+                totTermLength += indexedTermLength;
 
-                _lastTerm.CopyBytes(text);
-                NumIndexTerms++;
+                lastTerm.CopyBytes(text);
+                numIndexTerms++;
             }
 
             public override void Finish(long termsFilePointer)
             {
                 // write primary terms dict offsets
-                PackedIndexStart = outerInstance.Output.FilePointer;
+                packedIndexStart = outerInstance.Output.FilePointer;
 
-                PackedInts.Writer w = PackedInts.GetWriter(outerInstance.Output, NumIndexTerms,
+                PackedInts.Writer w = PackedInts.GetWriter(outerInstance.Output, numIndexTerms,
                     PackedInts.BitsRequired(termsFilePointer),
                     PackedInts.DEFAULT);
 
                 // relative to our indexStart
                 long upto = 0;
-                for (int i = 0; i < NumIndexTerms; i++)
+                for (int i = 0; i < numIndexTerms; i++)
                 {
-                    upto += _termsPointerDeltas[i];
+                    upto += termsPointerDeltas[i];
                     w.Add(upto);
                 }
                 w.Finish();
 
-                PackedOffsetsStart = outerInstance.Output.FilePointer;
+                packedOffsetsStart = outerInstance.Output.FilePointer;
 
                 // write offsets into the byte[] terms
-                w = PackedInts.GetWriter(outerInstance.Output, 1 + NumIndexTerms, PackedInts.BitsRequired(_totTermLength),
+                w = PackedInts.GetWriter(outerInstance.Output, 1 + numIndexTerms, PackedInts.BitsRequired(totTermLength),
                     PackedInts.DEFAULT);
                 upto = 0;
-                for (int i = 0; i < NumIndexTerms; i++)
+                for (int i = 0; i < numIndexTerms; i++)
                 {
                     w.Add(upto);
-                    upto += _termLengths[i];
+                    upto += termLengths[i];
                 }
                 w.Add(upto);
                 w.Finish();
 
                 // our referrer holds onto us, while other fields are
                 // being written, so don't tie up this RAM:
-                _termLengths = null;
-                _termsPointerDeltas = null;
+                termLengths = null;
+                termsPointerDeltas = null;
             }
         }
 
@@ -241,7 +241,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                     for (int i = 0; i < fieldCount; i++)
                     {
                         SimpleFieldWriter field = _fields[i];
-                        if (field.NumIndexTerms > 0)
+                        if (field.numIndexTerms > 0)
                         {
                             nonNullFieldCount++;
                         }
@@ -251,14 +251,14 @@ namespace Lucene.Net.Codecs.BlockTerms
                     for (int i = 0; i < fieldCount; i++)
                     {
                         SimpleFieldWriter field = _fields[i];
-                        if (field.NumIndexTerms > 0)
+                        if (field.numIndexTerms > 0)
                         {
-                            Output.WriteVInt(field.FieldInfo.Number);
-                            Output.WriteVInt(field.NumIndexTerms);
-                            Output.WriteVLong(field.TermsStart);
-                            Output.WriteVLong(field.IndexStart);
-                            Output.WriteVLong(field.PackedIndexStart);
-                            Output.WriteVLong(field.PackedOffsetsStart);
+                            Output.WriteVInt(field.fieldInfo.Number);
+                            Output.WriteVInt(field.numIndexTerms);
+                            Output.WriteVLong(field.termsStart);
+                            Output.WriteVLong(field.indexStart);
+                            Output.WriteVLong(field.packedIndexStart);
+                            Output.WriteVLong(field.packedOffsetsStart);
                         }
                     }
                     WriteTrailer(dirStart);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f46d3729/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
index 227c37b..35b0dc4 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
@@ -177,7 +177,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             private readonly long _indexStart;
             // Set only if terms index is loaded:
-            internal volatile FST<long?> Fst;
+            internal volatile FST<long?> fst;
             
             public FieldIndexData(VariableGapTermsIndexReader outerInstance, long indexStart)
             {
@@ -190,11 +190,11 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             private void LoadTermsIndex()
             {
-                if (Fst != null) return;
+                if (fst != null) return;
 
                 var clone = (IndexInput)outerInstance._input.Clone();
                 clone.Seek(_indexStart);
-                Fst = new FST<long?>(clone, outerInstance._fstOutputs);
+                fst = new FST<long?>(clone, outerInstance._fstOutputs);
                 clone.Dispose();
 
                 /*
@@ -211,7 +211,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                     var scratchIntsRef = new IntsRef();
                     var outputs = PositiveIntOutputs.Singleton;
                     var builder = new Builder<long?>(FST.INPUT_TYPE.BYTE1, outputs);
-                    var fstEnum = new BytesRefFSTEnum<long?>(Fst);
+                    var fstEnum = new BytesRefFSTEnum<long?>(fst);
                     var count = outerInstance._indexDivisor;
 
                     BytesRefFSTEnum.InputOutput<long?> result;
@@ -224,21 +224,21 @@ namespace Lucene.Net.Codecs.BlockTerms
                         }
                         count++;
                     }
-                    Fst = builder.Finish();
+                    fst = builder.Finish();
                 }
             }
 
             /// <summary>Returns approximate RAM bytes used</summary>
             public virtual long RamBytesUsed()
             {
-                return Fst == null ? 0 : Fst.SizeInBytes();
+                return fst == null ? 0 : fst.SizeInBytes();
             }
         }
 
         public override FieldIndexEnum GetFieldEnum(FieldInfo fieldInfo)
         {
             FieldIndexData fieldData = _fields[fieldInfo];
-            return fieldData.Fst == null ? null : new IndexEnum(fieldData.Fst);
+            return fieldData.fst == null ? null : new IndexEnum(fieldData.fst);
         }
 
         public override void Dispose()


Mime
View raw message