incubator-blur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccu...@apache.org
Subject [6/9] git commit: Added logging to the BlurLockFactory to figure out the issue with a mis-configured table. There were two tables referencing the same index location.
Date Tue, 19 Feb 2013 01:59:11 GMT
Added logging to the BlurLockFactory to figure out the issue with a mis-configured table. 
There were two tables referencing the same index location.


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

Branch: refs/heads/0.2-dev
Commit: 7a982c4d3ebf0d41a2262b1312de45d6ff29a752
Parents: eda33f5
Author: Aaron McCurry <amccurry@gmail.com>
Authored: Mon Feb 18 20:51:41 2013 -0500
Committer: Aaron McCurry <amccurry@gmail.com>
Committed: Mon Feb 18 20:51:41 2013 -0500

----------------------------------------------------------------------
 .../apache/blur/store/hdfs/BlurLockFactory.java    |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/7a982c4d/src/blur-store/src/main/java/org/apache/blur/store/hdfs/BlurLockFactory.java
----------------------------------------------------------------------
diff --git a/src/blur-store/src/main/java/org/apache/blur/store/hdfs/BlurLockFactory.java
b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/BlurLockFactory.java
index b1c3930..9f3bf00 100644
--- a/src/blur-store/src/main/java/org/apache/blur/store/hdfs/BlurLockFactory.java
+++ b/src/blur-store/src/main/java/org/apache/blur/store/hdfs/BlurLockFactory.java
@@ -19,6 +19,8 @@ package org.apache.blur.store.hdfs;
 import java.io.IOException;
 import java.util.Arrays;
 
+import org.apache.blur.log.Log;
+import org.apache.blur.log.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FSDataInputStream;
 import org.apache.hadoop.fs.FSDataOutputStream;
@@ -29,6 +31,8 @@ import org.apache.lucene.store.Lock;
 import org.apache.lucene.store.LockFactory;
 
 public class BlurLockFactory extends LockFactory {
+  
+  private static final Log LOG = LogFactory.getLog(BlurLockFactory.class);
 
   private final Configuration _configuration;
   private final FileSystem _fileSystem;
@@ -73,14 +77,17 @@ public class BlurLockFactory extends LockFactory {
       @Override
       public boolean isLocked() throws IOException {
         if (!_set) {
+          LOG.info("The lock has NOT been set.");
           return false;
         }
         if (!_fileSystem.exists(lockPath)) {
+          LOG.info("The lock file has been removed.");
           return false;
         }
         FileStatus fileStatus = _fileSystem.getFileStatus(lockPath);
         long len = fileStatus.getLen();
         if (len != _lockKey.length) {
+          LOG.info("The lock file length has changed.");
           return false;
         }
         byte[] buf = new byte[_lockKey.length];
@@ -90,6 +97,7 @@ public class BlurLockFactory extends LockFactory {
         if (Arrays.equals(_lockKey, buf)) {
           return true;
         }
+        LOG.info("The lock information has been changed.");
         return false;
       }
     };


Mime
View raw message