incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [1/2] git commit: Fixed BLUR-202
Date Mon, 12 Aug 2013 18:11:00 GMT
Updated Branches:
  refs/heads/master 2ff3c3124 -> 71b72250c


Fixed BLUR-202


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

Branch: refs/heads/master
Commit: 54bb4e2c7d3ce17be6d19ef26bad93846b58d653
Parents: 2ff3c31
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Aug 12 14:10:11 2013 -0400
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Aug 12 14:10:11 2013 -0400

----------------------------------------------------------------------
 .../org/apache/blur/lucene/warmup/TraceableDirectory.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/54bb4e2c/blur-store/src/main/java/org/apache/blur/lucene/warmup/TraceableDirectory.java
----------------------------------------------------------------------
diff --git a/blur-store/src/main/java/org/apache/blur/lucene/warmup/TraceableDirectory.java
b/blur-store/src/main/java/org/apache/blur/lucene/warmup/TraceableDirectory.java
index 2599755..7e092c3 100644
--- a/blur-store/src/main/java/org/apache/blur/lucene/warmup/TraceableDirectory.java
+++ b/blur-store/src/main/java/org/apache/blur/lucene/warmup/TraceableDirectory.java
@@ -54,15 +54,17 @@ public class TraceableDirectory extends Directory implements DirectoryDecorator
    * please post a question on the mail list first.
    */
   private boolean _trace = false;
-  private IndexTracer _indexTracer;
+  private ThreadLocal<IndexTracer> _indexTracer = new ThreadLocal<IndexTracer>();
 
   public TraceableDirectory(Directory dir) {
     _dir = dir;
   }
 
   public void trace(String name, long filePointer) {
-    if (_indexTracer != null) {
-      _indexTracer.trace(name, filePointer);
+    if (_trace) {
+      if (_indexTracer != null) {
+        _indexTracer.get().trace(name, filePointer);
+      }
     }
   }
 
@@ -107,7 +109,7 @@ public class TraceableDirectory extends Directory implements DirectoryDecorator
   }
 
   public void setIndexTracer(IndexTracer indexTracer) {
-    _indexTracer = indexTracer;
+    _indexTracer.set(indexTracer);
   }
 
   public Lock makeLock(String name) {


Mime
View raw message