accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject [2/8] git commit: ACCUMULO-1914 make WALog cleanup after recovery an atomic mutation
Date Thu, 21 Nov 2013 17:54:49 GMT
ACCUMULO-1914 make WALog cleanup after recovery an atomic mutation


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

Branch: refs/heads/master
Commit: 8bd6e0ebacb8fafeef8627807f610f10b036be6e
Parents: 32b6b65
Author: Eric Newton <eric.newton@gmail.com>
Authored: Thu Nov 21 12:19:01 2013 -0500
Committer: Eric Newton <eric.newton@gmail.com>
Committed: Thu Nov 21 12:19:01 2013 -0500

----------------------------------------------------------------------
 .../org/apache/accumulo/server/util/MetadataTable.java  | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/8bd6e0eb/src/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
----------------------------------------------------------------------
diff --git a/src/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java b/src/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
index 9c4eebf..a9b72e0 100644
--- a/src/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
+++ b/src/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
@@ -991,8 +991,8 @@ public class MetadataTable extends org.apache.accumulo.core.util.MetadataTable
{
   }
   
   public static void removeUnusedWALEntries(KeyExtent extent, List<LogEntry> logEntries,
ZooLock zooLock) {
-    for (LogEntry entry : logEntries) {
-      if (entry.extent.equals(Constants.ROOT_TABLET_EXTENT)) {
+      if (extent.equals(Constants.ROOT_TABLET_EXTENT)) {
+        for (LogEntry entry : logEntries) {
         String root = getZookeeperLogLocation();
         while (true) {
           try {
@@ -1005,11 +1005,13 @@ public class MetadataTable extends org.apache.accumulo.core.util.MetadataTable
{
           }
           UtilWaitThread.sleep(1000);
         }
+        }
       } else {
-        Mutation m = new Mutation(entry.extent.getMetadataEntry());
-        m.putDelete(Constants.METADATA_LOG_COLUMN_FAMILY, new Text(entry.server + "/" + entry.filename));
+        Mutation m = new Mutation(extent.getMetadataEntry());
+        for (LogEntry entry : logEntries) {
+          m.putDelete(Constants.METADATA_LOG_COLUMN_FAMILY, new Text(entry.server + "/" +
entry.filename));
+        }
         update(SecurityConstants.getSystemCredentials(), zooLock, m);
-      }
     }
   }
   


Mime
View raw message