lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1650025 - in /lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index: ConcurrentMergeScheduler.java IndexWriterConfig.java
Date Wed, 07 Jan 2015 10:24:16 GMT
Author: mikemccand
Date: Wed Jan  7 10:24:16 2015
New Revision: 1650025

URL: http://svn.apache.org/r1650025
Log:
LUCENE-6119: fix just arrived merge to throttle correctly

Modified:
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
    lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java?rev=1650025&r1=1650024&r2=1650025&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
(original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/ConcurrentMergeScheduler.java
Wed Jan  7 10:24:16 2015
@@ -462,6 +462,7 @@ public class ConcurrentMergeScheduler ex
         }
 
         merger.start();
+        updateMergeThreads();
 
         success = true;
       } finally {
@@ -649,12 +650,12 @@ public class ConcurrentMergeScheduler ex
   }
 
   /** Tunes IO throttle when a new merge starts. */
-  private synchronized void updateIOThrottle(OneMerge merge) throws IOException {
+  private synchronized void updateIOThrottle(OneMerge newMerge) throws IOException {
     if (doAutoIOThrottle == false) {
       return;
     }
 
-    double mergeMB = bytesToMB(merge.estimatedMergeBytes);
+    double mergeMB = bytesToMB(newMerge.estimatedMergeBytes);
     if (mergeMB < MIN_BIG_MERGE_MB) {
       // Only watch non-trivial merges for throttling; this is safe because the MP must eventually
       // have to do larger merges:
@@ -666,7 +667,7 @@ public class ConcurrentMergeScheduler ex
     // Simplistic closed-loop feedback control: if we find any other similarly
     // sized merges running, then we are falling behind, so we bump up the
     // IO throttle, else we lower it:
-    boolean newBacklog = isBacklog(now, merge);
+    boolean newBacklog = isBacklog(now, newMerge);
 
     boolean curBacklog = false;
 
@@ -721,8 +722,8 @@ public class ConcurrentMergeScheduler ex
       }
     }
 
+    newMerge.rateLimiter.setMBPerSec(targetMBPerSec);
     targetMBPerSecChanged();
-    updateMergeThreads();
   }
 
   /** Subclass can override to tweak targetMBPerSec. */

Modified: lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java?rev=1650025&r1=1650024&r2=1650025&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java (original)
+++ lucene/dev/trunk/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java Wed
Jan  7 10:24:16 2015
@@ -521,7 +521,7 @@ public final class IndexWriterConfig ext
   @Override
   public String toString() {
     StringBuilder sb = new StringBuilder(super.toString());
-    sb.append("writer=").append(writer).append("\n");
+    sb.append("writer=").append(writer.get()).append("\n");
     return sb.toString();
   }
   



Mime
View raw message