accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1416580 - /accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java
Date Mon, 03 Dec 2012 16:25:52 GMT
Author: ecn
Date: Mon Dec  3 16:25:51 2012
New Revision: 1416580

URL: http://svn.apache.org/viewvc?rev=1416580&view=rev
Log:
ACCUMULO-888 concurrent use of a logger can result in an NPE; make the error explicitly a
LoggerClosedException

Modified:
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java?rev=1416580&r1=1416579&r2=1416580&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/log/RemoteLogger.java
Mon Dec  3 16:25:51 2012
@@ -133,23 +133,33 @@ public class RemoteLogger {
     }
   }
   
+  private void checkClosed() throws LoggerClosedException {
+    if (client == null)
+      throw new LoggerClosedException();
+  }
+  
   public synchronized void defineTablet(int seq, int tid, KeyExtent tablet) throws NoSuchLogIDException,
LoggerClosedException, TException {
+    checkClosed();
     client.defineTablet(null, logFile.id, seq, tid, tablet.toThrift());
   }
   
   public synchronized void log(int seq, int tid, Mutation mutation) throws NoSuchLogIDException,
LoggerClosedException, TException {
+    checkClosed();
     client.log(null, logFile.id, seq, tid, mutation.toThrift());
   }
   
   public synchronized void logManyTablets(List<TabletMutations> mutations) throws NoSuchLogIDException,
LoggerClosedException, TException {
+    checkClosed();
     client.logManyTablets(null, logFile.id, mutations);
   }
   
   public synchronized void minorCompactionFinished(int seq, int tid, String fqfn) throws
NoSuchLogIDException, LoggerClosedException, TException {
+    checkClosed();
     client.minorCompactionFinished(null, logFile.id, seq, tid, fqfn);
   }
   
   public synchronized void minorCompactionStarted(int seq, int tid, String fqfn) throws NoSuchLogIDException,
LoggerClosedException, TException {
+    checkClosed();
     client.minorCompactionStarted(null, logFile.id, seq, tid, fqfn);
   }
   



Mime
View raw message