incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From twilli...@apache.org
Subject [1/3] git commit: use java lock directly and internally
Date Wed, 26 Feb 2014 02:07:16 GMT
Repository: incubator-blur
Updated Branches:
  refs/heads/apache-blur-0.2 e8ca8ecb7 -> 4c47521ec


use java lock directly and internally


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

Branch: refs/heads/apache-blur-0.2
Commit: 31cc873bae495dca9f392423bd3781e7a698e91c
Parents: e71d44a
Author: twilliams <twilliams@apache.org>
Authored: Tue Feb 25 19:51:47 2014 -0500
Committer: twilliams <twilliams@apache.org>
Committed: Tue Feb 25 19:51:47 2014 -0500

----------------------------------------------------------------------
 .../apache/blur/analysis/HdfsFieldManager.java  | 31 ++------------------
 1 file changed, 2 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/31cc873b/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
----------------------------------------------------------------------
diff --git a/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java b/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
index 4c311cd..8988e20 100644
--- a/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
+++ b/blur-query/src/main/java/org/apache/blur/analysis/HdfsFieldManager.java
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.UUID;
+import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.blur.log.Log;
@@ -44,14 +45,6 @@ public class HdfsFieldManager extends BaseFieldManager {
 
   private static final List<String> EMPTY_LIST = Arrays.asList(new String[] {});
 
-  public static abstract class Lock {
-
-    public abstract void lock();
-
-    public abstract void unlock();
-
-  }
-
   private static final Log LOG = LogFactory.getLog(HdfsFieldManager.class);
 
   private static final String FIELD_TYPE = "_fieldType_";
@@ -62,19 +55,7 @@ public class HdfsFieldManager extends BaseFieldManager {
   private static final String SUB_COLUMN_NAME = "_subColumnName_";
   private static final String TYPE_FILE_EXT = ".type";
 
-  private static Lock _lock = new Lock() {
-    private final java.util.concurrent.locks.Lock _javalock = new ReentrantReadWriteLock().writeLock();
-
-    @Override
-    public void lock() {
-      _javalock.lock();
-    }
-
-    @Override
-    public void unlock() {
-      _javalock.unlock();
-    }
-  };
+  private static final Lock _lock =  new ReentrantReadWriteLock().writeLock();
 
   private final Configuration _configuration;
   private final Path _storagePath;
@@ -240,12 +221,4 @@ public class HdfsFieldManager extends BaseFieldManager {
     return result;
   }
 
-  public static Lock getLock() {
-    return _lock;
-  }
-
-  public static void setLock(Lock lock) {
-    _lock = lock;
-  }
-
 }


Mime
View raw message