lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [03/50] [abbrv] lucenenet git commit: Lucene.Net.Memory.MemoryIndex refactor: MemorySize > GetMemorySize()
Date Wed, 15 Mar 2017 23:49:45 GMT
Lucene.Net.Memory.MemoryIndex refactor: MemorySize > GetMemorySize()


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

Branch: refs/heads/api-work
Commit: cd0f01e787fffa1119ed67430d3c6cc6d0705a46
Parents: 00fafce
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Tue Mar 14 00:15:16 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Tue Mar 14 07:49:33 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Memory/MemoryIndex.cs                        | 9 +++------
 src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd0f01e7/src/Lucene.Net.Memory/MemoryIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Memory/MemoryIndex.cs b/src/Lucene.Net.Memory/MemoryIndex.cs
index 3dbf24c..5985a40 100644
--- a/src/Lucene.Net.Memory/MemoryIndex.cs
+++ b/src/Lucene.Net.Memory/MemoryIndex.cs
@@ -595,12 +595,9 @@ namespace Lucene.Net.Index.Memory
         /// Returns a reasonable approximation of the main memory [bytes] consumed by
         /// this instance. Useful for smart memory sensititive caches/pools. </summary>
         /// <returns> the main memory consumption </returns>
-        public virtual long MemorySize
+        public virtual long GetMemorySize()
         {
-            get
-            {
-                return RamUsageEstimator.SizeOf(this);
-            }
+            return RamUsageEstimator.SizeOf(this);
         }
 
         /// <summary>
@@ -701,7 +698,7 @@ namespace Lucene.Net.Index.Memory
             result.Append("\nfields=" + sortedFields.Length);
             result.Append(", terms=" + sumTerms);
             result.Append(", positions=" + sumPositions);
-            result.Append(", memory=" + RamUsageEstimator.HumanReadableUnits(MemorySize));
+            result.Append(", memory=" + RamUsageEstimator.HumanReadableUnits(GetMemorySize()));
             return result.ToString();
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd0f01e7/src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs b/src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs
index 162202e..78439ff 100644
--- a/src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs
+++ b/src/Lucene.Net.Tests.Memory/Index/Memory/MemoryIndexTest.cs
@@ -116,7 +116,7 @@ namespace Lucene.Net.Index.Memory
             }
             else
             {
-                assertTrue(memory.MemorySize > 0L);
+                assertTrue(memory.GetMemorySize() > 0L);
             }
             AtomicReader reader = (AtomicReader)memory.CreateSearcher().IndexReader;
             DirectoryReader competitor = DirectoryReader.Open(ramdir);


Mime
View raw message