lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnas...@apache.org
Subject [4/5] lucenenet git commit: Updating Memory Codec
Date Sat, 08 Nov 2014 22:55:05 GMT
Updating Memory Codec


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

Branch: refs/heads/master
Commit: 0cc0e7eccc1d41dbfc193d271bc2818db5c7376b
Parents: 9971717
Author: Prescott Nasser <pnasser@apache.org>
Authored: Sat Nov 8 14:53:37 2014 -0800
Committer: Prescott Nasser <pnasser@apache.org>
Committed: Sat Nov 8 14:53:37 2014 -0800

----------------------------------------------------------------------
 .../Memory/DirectDocValuesConsumer.cs           |   16 +-
 .../Memory/DirectPostingsFormat.cs              | 5343 +++++++++---------
 .../Memory/FSTOrdPostingsFormat.cs              |  153 +-
 .../Memory/FSTOrdTermsWriter.cs                 |  837 ++-
 .../Memory/FSTPostingsFormat.cs                 |  152 +-
 src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs  |   14 +-
 .../Memory/MemoryDocValuesConsumer.cs           |  987 ++--
 .../Memory/MemoryDocValuesProducer.cs           | 1717 +++---
 .../Memory/MemoryPostingsFormat.cs              |  101 +-
 .../Util/Fst/PositiveIntOutputs.cs              |    1 -
 10 files changed, 4577 insertions(+), 4744 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0cc0e7ec/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs b/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
index 23e7a16..b9b157e 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectDocValuesConsumer.cs
@@ -46,11 +46,11 @@ namespace Lucene.Net.Codecs.Memory
                 string dataName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name,
state.SegmentSuffix,
                     dataExtension);
                 data = state.Directory.CreateOutput(dataName, state.Context);
-                CodecUtil.WriteHeader(data, dataCodec, VERSION_CURRENT);
+                CodecUtil.WriteHeader(data, dataCodec, MemoryDocValuesProducer.VERSION_CURRENT);
                 string metaName = IndexFileNames.SegmentFileName(state.SegmentInfo.Name,
state.SegmentSuffix,
                     metaExtension);
                 meta = state.Directory.CreateOutput(metaName, state.Context);
-                CodecUtil.WriteHeader(meta, metaCodec, VERSION_CURRENT);
+                CodecUtil.WriteHeader(meta, metaCodec, MemoryDocValuesProducer.VERSION_CURRENT);
                 success = true;
             }
             finally
@@ -65,7 +65,7 @@ namespace Lucene.Net.Codecs.Memory
         public override void AddNumericField(FieldInfo field, IEnumerable<long> values)
         {
             meta.WriteVInt(field.Number);
-            meta.WriteByte(NUMBER);
+            meta.WriteByte(MemoryDocValuesProducer.NUMBER);
             AddNumericFieldValues(field, values);
         }
 
@@ -194,7 +194,7 @@ namespace Lucene.Net.Codecs.Memory
         public override void AddBinaryField(FieldInfo field, IEnumerable<BytesRef>
values)
         {
             meta.WriteVInt(field.Number);
-            meta.WriteByte(BYTES);
+            meta.WriteByte(MemoryDocValuesProducer.BYTES);
             AddBinaryFieldValues(field, values);
         }
 
@@ -213,7 +213,7 @@ namespace Lucene.Net.Codecs.Memory
                     totalBytes += v.Length;
                     if (totalBytes > DirectDocValuesFormat.MAX_TOTAL_BYTES_LENGTH)
                     {
-                        throw new ArgumentException("DocValuesField \"" + field.name +
+                        throw new ArgumentException("DocValuesField \"" + field.Name +
                                                            "\" is too large, cannot have
more than DirectDocValuesFormat.MAX_TOTAL_BYTES_LENGTH (" +
                                                            DirectDocValuesFormat.MAX_TOTAL_BYTES_LENGTH
+ ") bytes");
                     }
@@ -310,7 +310,7 @@ namespace Lucene.Net.Codecs.Memory
             AddBinaryFieldValues(field, values);
         }
 
-        private class IterableAnonymousInnerClassHelper : IEnumerable<Number>
+        private class IterableAnonymousInnerClassHelper : IEnumerable<long>
         {
             private readonly DirectDocValuesConsumer _outerInstance;
             private readonly IEnumerable<long> _docToOrdCount;
@@ -322,11 +322,9 @@ namespace Lucene.Net.Codecs.Memory
                 _docToOrdCount = docToOrdCount;
             }
 
-
             // Just aggregates the count values so they become
             // "addresses", and adds one more value in the end
             // (the final sum):
-
             public virtual IEnumerator<long> GetEnumerator()
             {
                 var iter = _docToOrdCount.GetEnumerator();
@@ -335,13 +333,11 @@ namespace Lucene.Net.Codecs.Memory
 
             private class IteratorAnonymousInnerClassHelper : IEnumerator<long>
             {
-                private readonly IterableAnonymousInnerClassHelper outerInstance;
                 private readonly IEnumerator<long> _iter;
 
                 public IteratorAnonymousInnerClassHelper(IterableAnonymousInnerClassHelper
outerInstance,
                     IEnumerator<long> iter)
                 {
-                    this.outerInstance = outerInstance;
                     _iter = iter;
                 }
 


Mime
View raw message