incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [4/6] git commit: The commit in the optimize call needed to be wrapped in the writer lock.
Date Wed, 08 Jan 2014 03:27:40 GMT
The commit in the optimize call needed to be wrapped in the writer lock.


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

Branch: refs/heads/master
Commit: bcd89b31a8be85bee69f04bab5c85695542c580e
Parents: ef0376d
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Tue Jan 7 20:51:46 2014 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Tue Jan 7 22:27:25 2014 -0500

----------------------------------------------------------------------
 .../org/apache/blur/manager/writer/BlurIndexSimpleWriter.java | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/bcd89b31/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
----------------------------------------------------------------------
diff --git a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
index 6548522..13d8d50 100644
--- a/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
+++ b/blur-core/src/main/java/org/apache/blur/manager/writer/BlurIndexSimpleWriter.java
@@ -213,7 +213,12 @@ public class BlurIndexSimpleWriter extends BlurIndex {
           waitUntilNotNull(_writer);
           BlurIndexWriter writer = _writer.get();
           writer.forceMerge(numberOfSegmentsPerShard, true);
-          writer.commit();
+          _writeLock.lock();
+          try {
+            commit();
+          } finally {
+            _writeLock.unlock();
+          }
         } catch (Exception e) {
           LOG.error("Unknown error during optimize on table [{0}] shard [{1}]", e, table,
shard);
         }


Mime
View raw message