accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [1/5] accumulo git commit: ACCUMULO-3767 current log might be null
Date Fri, 01 May 2015 05:14:53 GMT
Repository: accumulo
Updated Branches:
  refs/heads/1.7 4d1acd14a -> fae7a8224
  refs/heads/master a03f14a5c -> e25146d0d


ACCUMULO-3767 current log might be null

A server might not have a current log. Account
for that, specifically for getActiveLogs().


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/2b48d1cc
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/2b48d1cc
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/2b48d1cc

Branch: refs/heads/1.7
Commit: 2b48d1cc48e8c494f1f537790d71a8ab716a21f4
Parents: 4d1acd1
Author: Josh Elser <elserj@apache.org>
Authored: Thu Apr 30 23:38:08 2015 -0400
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Apr 30 23:38:08 2015 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/tserver/TabletServer.java  | 4 ++++
 .../org/apache/accumulo/tserver/log/TabletServerLogger.java  | 8 ++++++++
 2 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/2b48d1cc/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index aeb73b4..96f33aa 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -1716,6 +1716,10 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
     @Override
     public List<String> getActiveLogs(TInfo tinfo, TCredentials credentials) throws
TException {
       String log = logger.getLogFile();
+      // Might be null if there no active logger
+      if (null == log) {
+        return Collections.emptyList();
+      }
       return Collections.singletonList(log);
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/2b48d1cc/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
index bc77ffb..a2ab551 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/log/TabletServerLogger.java
@@ -180,9 +180,17 @@ public class TabletServerLogger {
     return result.get();
   }
 
+  /**
+   * Get the current WAL file
+   *
+   * @return The name of the current log, or null if there is no current log.
+   */
   public String getLogFile() {
     logIdLock.readLock().lock();
     try {
+      if (null == currentLog) {
+        return null;
+      }
       return currentLog.getFileName();
     } finally {
       logIdLock.readLock().unlock();


Mime
View raw message