accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1468577 - in /accumulo/trunk: ./ assemble/ core/ examples/ fate/src/main/java/org/apache/accumulo/fate/ fate/src/main/java/org/apache/accumulo/fate/zookeeper/ server/ server/src/main/java/org/apache/accumulo/server/gc/ server/src/main/java...
Date Tue, 16 Apr 2013 19:44:04 GMT
Author: ecn
Date: Tue Apr 16 19:44:03 2013
New Revision: 1468577

URL: http://svn.apache.org/r1468577
Log:
ACCUMULO-1264 add a little upgrade to move !METDATA file deletion markers to the root tablet

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/assemble/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/examples/   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java 
 (props changed)
    accumulo/trunk/pom.xml   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1468576

Propchange: accumulo/trunk/assemble/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/assemble:r1468576

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/core:r1468576

Propchange: accumulo/trunk/examples/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/examples:r1468576

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1468576

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1468576

Propchange: accumulo/trunk/pom.xml
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/pom.xml:r1468576

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/server:r1468576

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java?rev=1468577&r1=1468576&r2=1468577&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/gc/SimpleGarbageCollector.java
Tue Apr 16 19:44:03 2013
@@ -737,6 +737,13 @@ public class SimpleGarbageCollector impl
         log.error("Problem removing entries from the metadata table: ", e);
       }
     }
+    if (rootWriter != null) {
+      try {
+        rootWriter.close();
+      } catch (MutationsRejectedException e) {
+        log.error("Problem removing entries from the metadata table: ", e);
+      }
+    }
   }
   
   private boolean isDir(String delete) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java?rev=1468577&r1=1468576&r2=1468577&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/Master.java Tue
Apr 16 19:44:03 2013
@@ -304,6 +304,7 @@ public class Master implements LiveTServ
           @Override
           public void run() {
             try {
+              MetadataTable.moveMetaDeleteMarkers(instance, SecurityConstants.getSystemCredentials());
               Accumulo.updateAccumuloVersion(fs);
               
               log.info("Upgrade complete");

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java?rev=1468577&r1=1468576&r2=1468577&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/util/MetadataTable.java
Tue Apr 16 19:44:03 2013
@@ -1230,4 +1230,28 @@ public class MetadataTable extends org.a
     
     update(SecurityConstants.getSystemCredentials(), m);
   }
+
+  public static void moveMetaDeleteMarkers(Instance instance, TCredentials creds) {
+    // move delete markers from the normal delete keyspace to the root tablet delete keyspace
if the files are for the !METADATA table
+    Scanner scanner = new ScannerImpl(instance, creds, Constants.METADATA_TABLE_ID, Constants.NO_AUTHS);
+    scanner.setRange(new Range(Constants.METADATA_DELETES_KEYSPACE));
+    for (Entry<Key,Value> entry : scanner) {
+      String row = entry.getKey().getRow().toString();
+      if (row.startsWith(Constants.METADATA_DELETE_FLAG_PREFIX + "/" + Constants.METADATA_TABLE_ID))
{
+        String filename = row.substring(Constants.METADATA_DELETE_FLAG_PREFIX.length());
+        // add the new entry first
+        log.info("Moving " + filename + " marker to the root tablet");
+        Mutation m = new Mutation(Constants.METADATA_DELETE_FLAG_FOR_METADATA_PREFIX + filename);
+        m.put(new byte[]{}, new byte[]{}, new byte[]{});
+        update(creds, m);
+        // remove the old entry
+        m = new Mutation(entry.getKey().getRow());
+        m.putDelete(new byte[]{}, new byte[]{});
+        update(creds, m);
+      } else {
+        break;
+      }
+    }
+    
+  }
 }

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5/src:r1468576



Mime
View raw message