You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by el...@apache.org on 2014/10/31 22:27:06 UTC

[07/12] git commit: ACCUMULO-3213 Fix the moveToTrash method name to be more accurate (archive or move to trash)

ACCUMULO-3213 Fix the moveToTrash method name to be more accurate (archive or move to trash)


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

Branch: refs/heads/master
Commit: ded67f1867874d46e69b4d28084eaed3a3844009
Parents: 7ce1a64
Author: Josh Elser <el...@apache.org>
Authored: Tue Oct 28 23:58:50 2014 -0400
Committer: Josh Elser <el...@apache.org>
Committed: Fri Oct 31 14:59:47 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/accumulo/gc/SimpleGarbageCollector.java    | 6 +++---
 .../org/apache/accumulo/gc/SimpleGarbageCollectorTest.java     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/ded67f18/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 308d7b9..55548e3 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -406,7 +406,7 @@ public class SimpleGarbageCollector implements Iface {
 
               log.debug("Deleting " + fullPath);
 
-              if (moveToTrash(fullPath) || fs.deleteRecursively(fullPath)) {
+              if (archiveOrMoveToTrash(fullPath) || fs.deleteRecursively(fullPath)) {
                 // delete succeeded, still want to delete
                 removeFlag = true;
                 synchronized (SimpleGarbageCollector.this) {
@@ -492,7 +492,7 @@ public class SimpleGarbageCollector implements Iface {
         if (tabletDirs.length == 0) {
           Path p = new Path(dir + "/" + tableID);
           log.debug("Removing table dir " + p);
-          if (!moveToTrash(p))
+          if (!archiveOrMoveToTrash(p))
             fs.delete(p);
         }
       }
@@ -606,7 +606,7 @@ public class SimpleGarbageCollector implements Iface {
    * @throws IOException
    *           if the volume manager encountered a problem
    */
-  boolean moveToTrash(Path path) throws IOException {
+  boolean archiveOrMoveToTrash(Path path) throws IOException {
     if (shouldArchiveFiles()) {
       return archiveFile(path);
     } else {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/ded67f18/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java
----------------------------------------------------------------------
diff --git a/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java b/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java
index d4319b8..672aee2 100644
--- a/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java
+++ b/server/gc/src/test/java/org/apache/accumulo/gc/SimpleGarbageCollectorTest.java
@@ -103,7 +103,7 @@ public class SimpleGarbageCollectorTest {
     Path path = createMock(Path.class);
     expect(volMgr.moveToTrash(path)).andReturn(true);
     replay(volMgr);
-    assertTrue(gc.moveToTrash(path));
+    assertTrue(gc.archiveOrMoveToTrash(path));
     verify(volMgr);
   }
 
@@ -113,7 +113,7 @@ public class SimpleGarbageCollectorTest {
     Path path = createMock(Path.class);
     expect(volMgr.moveToTrash(path)).andThrow(new FileNotFoundException());
     replay(volMgr);
-    assertFalse(gc.moveToTrash(path));
+    assertFalse(gc.archiveOrMoveToTrash(path));
     verify(volMgr);
   }
 
@@ -127,7 +127,7 @@ public class SimpleGarbageCollectorTest {
     replay(systemConfig);
     gc.init(volMgr, instance, credentials, systemConfig);
     Path path = createMock(Path.class);
-    assertFalse(gc.moveToTrash(path));
+    assertFalse(gc.archiveOrMoveToTrash(path));
   }
 
   @Test