You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/11/19 01:36:05 UTC

[1/2] git commit: ACCUMULO-1831 fix recovered log cleanup

Updated Branches:
  refs/heads/master cfdc869a8 -> 44338a9b8


ACCUMULO-1831 fix recovered log cleanup


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

Branch: refs/heads/master
Commit: 437da6ec69fc05958c60a47c2ac768473ec89827
Parents: c10ccf3
Author: Eric Newton <er...@gmail.com>
Authored: Mon Nov 18 19:35:34 2013 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Mon Nov 18 19:35:44 2013 -0500

----------------------------------------------------------------------
 .../gc/GarbageCollectWriteAheadLogs.java        | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/437da6ec/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
index 6eed80d..51ed477 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/GarbageCollectWriteAheadLogs.java
@@ -74,7 +74,7 @@ public class GarbageCollectWriteAheadLogs {
     Span span = Trace.start("scanServers");
     try {
       
-      Set<Path> sortedWALogs = getSortedWALogs();
+      Map<String, Path> sortedWALogs = getSortedWALogs();
       
       status.currentLog.started = System.currentTimeMillis();
       
@@ -132,7 +132,7 @@ public class GarbageCollectWriteAheadLogs {
     }
   }
   
-  private int removeFiles(Map<String,Path> nameToFileMap, Map<String,ArrayList<Path>> serverToFileMap, Set<Path> sortedWALogs, final GCStatus status) {
+  private int removeFiles(Map<String,Path> nameToFileMap, Map<String,ArrayList<Path>> serverToFileMap, Map<String, Path> sortedWALogs, final GCStatus status) {
     AccumuloConfiguration conf = instance.getConfiguration();
     for (Entry<String,ArrayList<Path>> entry : serverToFileMap.entrySet()) {
       if (entry.getKey().isEmpty()) {
@@ -182,7 +182,7 @@ public class GarbageCollectWriteAheadLogs {
       }
     }
     
-    for (Path swalog : sortedWALogs) {
+    for (Path swalog : sortedWALogs.values()) {
       log.debug("Removing sorted WAL " + swalog);
       try {
         if (!useTrash || !fs.moveToTrash(swalog)) {
@@ -226,7 +226,7 @@ public class GarbageCollectWriteAheadLogs {
     return result;
   }
   
-  private int removeMetadataEntries(Map<String,Path>  nameToFileMap, Set<Path> sortedWALogs, GCStatus status) throws IOException, KeeperException,
+  private int removeMetadataEntries(Map<String,Path>  nameToFileMap, Map<String, Path> sortedWALogs, GCStatus status) throws IOException, KeeperException,
       InterruptedException {
     int count = 0;
     Iterator<LogEntry> iterator = MetadataTableUtil.getLogEntries(SystemCredentials.get());
@@ -243,7 +243,7 @@ public class GarbageCollectWriteAheadLogs {
         Path pathFromNN = nameToFileMap.remove(path.getName());
         if (pathFromNN != null) {
           status.currentLog.inUse++;
-          sortedWALogs.remove(pathFromNN);
+          sortedWALogs.remove(path.getName());
         }
         count++;
       }
@@ -280,21 +280,20 @@ public class GarbageCollectWriteAheadLogs {
         }
       }
     }
-    log.debug("fileToServerMap " + fileToServerMap);
-    log.debug("nameToFileMap " + nameToFileMap);
     return servers.size();
   }
   
-  private Set<Path> getSortedWALogs() throws IOException {
-    Set<Path> result = new HashSet<Path>();
+  private Map<String, Path> getSortedWALogs() throws IOException {
+    Map<String, Path> result = new HashMap<String, Path>();
     
     for (String dir : ServerConstants.getRecoveryDirs()) {
       Path recoveryDir = new Path(dir);
       
       if (fs.exists(recoveryDir)) {
         for (FileStatus status : fs.listStatus(recoveryDir)) {
-          if (isUUID(status.getPath().getName())) {
-            result.add(status.getPath());
+          String name = status.getPath().getName();
+          if (isUUID(name)) {
+            result.put(name, status.getPath());
           } else {
             log.debug("Ignoring file " + status.getPath() + " because it doesn't look like a uuid");
           }


[2/2] git commit: Merge branch '1.6.0-SNAPSHOT'

Posted by ec...@apache.org.
Merge branch '1.6.0-SNAPSHOT'


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

Branch: refs/heads/master
Commit: 44338a9b8c262f5b50b967da2997a28f997dde6a
Parents: cfdc869 437da6e
Author: Eric Newton <er...@gmail.com>
Authored: Mon Nov 18 19:36:15 2013 -0500
Committer: Eric Newton <er...@gmail.com>
Committed: Mon Nov 18 19:36:15 2013 -0500

----------------------------------------------------------------------
 .../gc/GarbageCollectWriteAheadLogs.java        | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------