lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r1209334 - /lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Date Fri, 02 Dec 2011 02:41:48 GMT
Author: yonik
Date: Fri Dec  2 02:41:47 2011
New Revision: 1209334

URL: http://svn.apache.org/viewvc?rev=1209334&view=rev
Log:
make commits blockable too

Modified:
    lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java

Modified: lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java?rev=1209334&r1=1209333&r2=1209334&view=diff
==============================================================================
--- lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
(original)
+++ lucene/dev/branches/solrcloud/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java
Fri Dec  2 02:41:47 2011
@@ -556,9 +556,22 @@ public class DistributedUpdateProcessor 
   @Override
   public void processCommit(CommitUpdateCommand cmd) throws IOException {
 
-    if (ulog.getState() != UpdateLog.State.ACTIVE && (cmd.getFlags() & UpdateCommand.REPLAY)
== 0) {
-      log.info("Ignoring commit while not ACTIVE");
-      return;
+    if (vinfo != null) {
+      vinfo.lockForUpdate();
+    }
+    try {
+
+      if (ulog.getState() != UpdateLog.State.ACTIVE && (cmd.getFlags() & UpdateCommand.REPLAY)
== 0) {
+        log.info("Ignoring commit while not ACTIVE");
+        return;
+      }
+
+      super.processCommit(cmd);
+
+    } finally {
+      if (vinfo != null) {
+        vinfo.unlockForUpdate();
+      }
     }
 
 
@@ -566,7 +579,7 @@ public class DistributedUpdateProcessor 
 //    if (shards != null) {
 //      cmdDistrib.distribCommit(cmd, shards);
 //    } else {
-      super.processCommit(cmd);
+//      super.processCommit(cmd);
 //    }
   }
   



Mime
View raw message