accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1450909 - in /accumulo/branches/1.4: ./ src/ src/core/ src/server/ src/server/src/ src/server/src/main/java/org/apache/accumulo/server/master/ src/server/src/main/java/org/apache/accumulo/server/tabletserver/ src/server/src/main/java/org/a...
Date Wed, 27 Feb 2013 18:43:38 GMT
Author: ecn
Date: Wed Feb 27 18:43:38 2013
New Revision: 1450909

URL: http://svn.apache.org/r1450909
Log:
ACCUMULO-919 port the Trash updates back to 1.4

Modified:
    accumulo/branches/1.4/   (props changed)
    accumulo/branches/1.4/src/   (props changed)
    accumulo/branches/1.4/src/core/   (props changed)
    accumulo/branches/1.4/src/server/   (props changed)
    accumulo/branches/1.4/src/server/src/   (props changed)
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/CoordinateRecoveryTask.java
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
    accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/BulkSplitOptimizationTest.java

Propchange: accumulo/branches/1.4/
------------------------------------------------------------------------------
  Merged /accumulo/trunk:r1446314

Propchange: accumulo/branches/1.4/src/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/src:r1446314
  Merged /accumulo/trunk:r1446314

Propchange: accumulo/branches/1.4/src/core/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/src/core:r1446314
  Merged /accumulo/trunk/core:r1446314

Propchange: accumulo/branches/1.4/src/server/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/src/server:r1446314
  Merged /accumulo/trunk/server:r1446314

Propchange: accumulo/branches/1.4/src/server/src/
------------------------------------------------------------------------------
  Merged /accumulo/trunk/server/src:r1446314
  Merged /accumulo/trunk/src/server/src:r1446314

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/CoordinateRecoveryTask.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/CoordinateRecoveryTask.java?rev=1450909&r1=1450908&r2=1450909&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/CoordinateRecoveryTask.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/master/CoordinateRecoveryTask.java
Wed Feb 27 18:43:38 2013
@@ -46,6 +46,7 @@ import org.apache.hadoop.fs.ContentSumma
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.Trash;
 import org.apache.hadoop.mapred.JobClient;
 import org.apache.hadoop.mapred.JobStatus;
 import org.apache.hadoop.mapred.RunningJob;
@@ -61,6 +62,8 @@ public class CoordinateRecoveryTask impl
   private boolean stop = false;
   
   private ZooCache zcache;
+
+  private Trash trash;
   
   private static String fullName(String name) {
     return ServerConstants.getRecoveryDir() + "/" + name;
@@ -259,8 +262,9 @@ public class CoordinateRecoveryTask impl
     }
   }
   
-  public CoordinateRecoveryTask(FileSystem fs) {
+  public CoordinateRecoveryTask(FileSystem fs) throws IOException {
     this.fs = fs;
+    this.trash = new Trash(fs, fs.getConf());
     zcache = new ZooCache();
   }
   
@@ -345,7 +349,8 @@ public class CoordinateRecoveryTask impl
       if (children != null) {
         for (FileStatus child : children) {
           log.info("Deleting recovery directory " + child);
-          fs.delete(child.getPath(), true);
+          if (!trash.moveToTrash(child.getPath()))
+            fs.delete(child.getPath(), true);
         }
       }
     } catch (IOException e) {

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java?rev=1450909&r1=1450908&r2=1450909&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/tabletserver/Tablet.java
Wed Feb 27 18:43:38 2013
@@ -124,6 +124,7 @@ import org.apache.hadoop.conf.Configurat
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.fs.Trash;
 import org.apache.hadoop.io.Text;
 import org.apache.log4j.Logger;
 import org.apache.zookeeper.KeeperException;
@@ -1024,8 +1025,11 @@ public class Tablet {
           
           // start deleting files, if we do not finish they will be cleaned
           // up later
+          Trash trash = new Trash(fs, fs.getConf());
           for (Path path : oldDatafiles) {
-            fs.delete(new Path(location + "/delete+" + compactName + "+" + path.getName()),
true);
+            Path deleteFile = new Path(location + "/delete+" + compactName + "+" + path.getName());
+            if (!trash.moveToTrash(deleteFile))
+              fs.delete(deleteFile, true);
           }
         }
         

Modified: accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/BulkSplitOptimizationTest.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/BulkSplitOptimizationTest.java?rev=1450909&r1=1450908&r2=1450909&view=diff
==============================================================================
--- accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/BulkSplitOptimizationTest.java
(original)
+++ accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/functional/BulkSplitOptimizationTest.java
Wed Feb 27 18:43:38 2013
@@ -27,7 +27,6 @@ import org.apache.accumulo.server.test.C
 import org.apache.accumulo.server.test.VerifyIngest;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
-import org.apache.log4j.Logger;
 
 /**
  * This test verifies that when a lot of files are bulk imported into a table with one tablet
and then splits that not all map files go to the children tablets.



Mime
View raw message