accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhava...@apache.org
Subject git commit: ACCUMULO-2322 Tablet constructor no longer leaks this to recovery process
Date Tue, 04 Feb 2014 20:52:22 GMT
Updated Branches:
  refs/heads/master eade3b59d -> 47cdb9227


ACCUMULO-2322 Tablet constructor no longer leaks this to recovery process

The method signatures for TabletServer.recover() and TabletServerLogger.recover()
were modified so that the Tablet constructor no longer needs to pass this.


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

Branch: refs/heads/master
Commit: 47cdb92275126ba27157dd8fefa54b30c446c3c8
Parents: eade3b5
Author: Bill Havanki <bhavanki@cloudera.com>
Authored: Tue Feb 4 15:48:30 2014 -0500
Committer: Bill Havanki <bhavanki@cloudera.com>
Committed: Tue Feb 4 15:48:30 2014 -0500

----------------------------------------------------------------------
 .../main/java/org/apache/accumulo/tserver/Tablet.java   |  2 +-
 .../java/org/apache/accumulo/tserver/TabletServer.java  |  6 +++---
 .../apache/accumulo/tserver/log/TabletServerLogger.java | 12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/47cdb922/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
index 27412db..c06561a 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/Tablet.java
@@ -1366,7 +1366,7 @@ public class Tablet {
         for (FileRef ref : datafiles.keySet())
           absPaths.add(ref.path().toString());
 
-        tabletServer.recover(this.tabletServer.getFileSystem(), this, logEntries, absPaths,
new MutationReceiver() {
+        tabletServer.recover(this.tabletServer.getFileSystem(), extent, acuTableConf, logEntries,
absPaths, new MutationReceiver() {
           @Override
           public void receive(Mutation m) {
             // LogReader.printMutation(m);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/47cdb922/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 457bd8a..de0ccb4 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
@@ -3667,7 +3667,7 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
     logger.minorCompactionStarted(tablet, lastUpdateSequence, newMapfileLocation);
   }
 
-  public void recover(VolumeManager fs, Tablet tablet, List<LogEntry> logEntries, Set<String>
tabletFiles, MutationReceiver mutationReceiver)
+  public void recover(VolumeManager fs, KeyExtent extent, TableConfiguration tconf, List<LogEntry>
logEntries, Set<String> tabletFiles, MutationReceiver mutationReceiver)
       throws IOException {
     List<Path> recoveryLogs = new ArrayList<Path>();
     List<LogEntry> sorted = new ArrayList<LogEntry>(logEntries);
@@ -3689,10 +3689,10 @@ public class TabletServer extends AbstractMetricsImpl implements org.apache.accu
         }
       }
       if (recovery == null)
-        throw new IOException("Unable to find recovery files for extent " + tablet.getExtent()
+ " logEntry: " + entry);
+        throw new IOException("Unable to find recovery files for extent " + extent + " logEntry:
" + entry);
       recoveryLogs.add(recovery);
     }
-    logger.recover(fs, tablet, recoveryLogs, tabletFiles, mutationReceiver);
+    logger.recover(fs, extent, tconf, recoveryLogs, tabletFiles, mutationReceiver);
   }
 
   private final AtomicInteger logIdGenerator = new AtomicInteger();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/47cdb922/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 14905af..c88ee1e 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
@@ -34,6 +34,7 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
 import org.apache.accumulo.core.util.UtilWaitThread;
+import org.apache.accumulo.server.conf.TableConfiguration;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.tserver.Tablet;
 import org.apache.accumulo.tserver.Tablet.CommitSession;
@@ -76,12 +77,12 @@ public class TabletServerLogger {
   
   private final AtomicInteger seqGen = new AtomicInteger();
   
-  private static boolean enabled(Tablet tablet) {
-    return tablet.getTableConfiguration().getBoolean(Property.TABLE_WALOG_ENABLED);
+  private static boolean enabled(TableConfiguration tconf) {
+    return tconf.getBoolean(Property.TABLE_WALOG_ENABLED);
   }
   
   private static boolean enabled(CommitSession commitSession) {
-    return enabled(commitSession.getTablet());
+    return enabled(commitSession.getTablet().getTableConfiguration());
   }
   
   static private abstract class TestCallWithWriteLock {
@@ -415,12 +416,11 @@ public class TabletServerLogger {
     return seq;
   }
   
-  public void recover(VolumeManager fs, Tablet tablet, List<Path> logs, Set<String>
tabletFiles, MutationReceiver mr) throws IOException {
-    if (!enabled(tablet))
+  public void recover(VolumeManager fs, KeyExtent extent, TableConfiguration tconf, List<Path>
logs, Set<String> tabletFiles, MutationReceiver mr) throws IOException {
+    if (!enabled(tconf))
       return;
     try {
       SortedLogRecovery recovery = new SortedLogRecovery(fs);
-      KeyExtent extent = tablet.getExtent();
       recovery.recover(extent, logs, tabletFiles, mr);
     } catch (Exception e) {
       throw new IOException(e);


Mime
View raw message