lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [5/6] lucenenet git commit: remove indexwriter debug.assert side effects
Date Sat, 09 May 2015 18:46:29 GMT
remove indexwriter debug.assert side effects


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

Branch: refs/heads/master
Commit: 085519ac92f459d207a96fe5246275bb00ffd755
Parents: 185e3e1
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Fri May 8 16:53:34 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Fri May 8 16:53:34 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Index/IndexWriter.cs | 34 +++++++++++++++++----------
 1 file changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/085519ac/src/Lucene.Net.Core/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexWriter.cs b/src/Lucene.Net.Core/Index/IndexWriter.cs
index 4fce66b..1067ab5 100644
--- a/src/Lucene.Net.Core/Index/IndexWriter.cs
+++ b/src/Lucene.Net.Core/Index/IndexWriter.cs
@@ -2576,8 +2576,8 @@ namespace Lucene.Net.Index
                         infoStream.Message("IW", "rollback: infos=" + SegString(segmentInfos.Segments));
                     }
 
-                    var result = TestPoint("rollback before checkpoint");
-                    Debug.Assert(result);
+                    var tpResult = TestPoint("rollback before checkpoint");
+                    Debug.Assert(tpResult);
 
                     // Ask deleter to locate unreferenced files & remove
                     // them:
@@ -3557,7 +3557,8 @@ namespace Lucene.Net.Index
                 }
 
                 DoBeforeFlush();
-                Debug.Assert(TestPoint("startDoFlush"));
+                var tpResult = TestPoint("startDoFlush");
+                Debug.Assert(tpResult);
                 SegmentInfos toCommit = null;
                 bool anySegmentsFlushed = false;
 
@@ -3863,7 +3864,8 @@ namespace Lucene.Net.Index
             }
 
             DoBeforeFlush();
-            Debug.Assert(TestPoint("startDoFlush"));
+            var tpResult = TestPoint("startDoFlush");
+            Debug.Assert(tpResult);
             bool success = false;
             try
             {
@@ -4103,7 +4105,8 @@ namespace Lucene.Net.Index
         {
             lock (this)
             {
-                Debug.Assert(TestPoint("startCommitMergeDeletes"));
+                var tpResult = TestPoint("startCommitMergeDeletes");
+                Debug.Assert(tpResult);
 
                 IList<SegmentCommitInfo> sourceSegments = merge.Segments;
 
@@ -4339,7 +4342,8 @@ namespace Lucene.Net.Index
         {
             lock (this)
             {
-                Debug.Assert(TestPoint("startCommitMerge"));
+                var tpResult = TestPoint("startCommitMerge");
+                Debug.Assert(tpResult);
 
                 if (HitOOM)
                 {
@@ -4758,7 +4762,8 @@ namespace Lucene.Net.Index
         {
             lock (this)
             {
-                Debug.Assert(TestPoint("startMergeInit"));
+                var testPointResult = TestPoint("startMergeInit");
+                Debug.Assert(testPointResult);
 
                 Debug.Assert(merge.RegisterDone);
                 Debug.Assert(merge.MaxNumSegments == -1 || merge.MaxNumSegments > 0);
@@ -5440,7 +5445,8 @@ namespace Lucene.Net.Index
         /// </summary>
         private void StartCommit(SegmentInfos toSync)
         {
-            Debug.Assert(TestPoint("startStartCommit"));
+            var tpResult = TestPoint("startStartCommit");
+            Debug.Assert(tpResult);
             Debug.Assert(PendingCommit == null);
 
             if (HitOOM)
@@ -5478,13 +5484,15 @@ namespace Lucene.Net.Index
                     Debug.Assert(FilesExist(toSync));
                 }
 
-                Debug.Assert(TestPoint("midStartCommit"));
+                tpResult = TestPoint("midStartCommit");
+                Debug.Assert(tpResult);
 
                 bool pendingCommitSet = false;
 
                 try
                 {
-                    Debug.Assert(TestPoint("midStartCommit2"));
+                    tpResult = TestPoint("midStartCommit2");
+                    Debug.Assert(tpResult);
 
                     lock (this)
                     {
@@ -5527,7 +5535,8 @@ namespace Lucene.Net.Index
                         infoStream.Message("IW", "done all syncs: " + filesToSync);
                     }
 
-                    Debug.Assert(TestPoint("midStartCommitSuccess"));
+                    tpResult = TestPoint("midStartCommitSuccess");
+                    Debug.Assert(tpResult);
                 }
                 finally
                 {
@@ -5557,7 +5566,8 @@ namespace Lucene.Net.Index
             {
                 HandleOOM(oom, "startCommit");
             }
-            Debug.Assert(TestPoint("finishStartCommit"));
+            tpResult = TestPoint("finishStartCommit");
+            Debug.Assert(tpResult);
         }
 
         /// <summary>


Mime
View raw message