accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [1/5] git commit: ACCUMULO-2012 Cloning accumulo.metadata works, accumulo.root will have a better error
Date Thu, 30 Jan 2014 00:06:39 GMT
Updated Branches:
  refs/heads/master 92e2f8e48 -> f115f1979


ACCUMULO-2012 Cloning accumulo.metadata works, accumulo.root will have a better error


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

Branch: refs/heads/master
Commit: d4c9ee1c529ebef80368d587db31e331d911953f
Parents: 7e95b3f
Author: John Vines <vines@apache.org>
Authored: Wed Jan 29 17:54:55 2014 -0500
Committer: John Vines <vines@apache.org>
Committed: Wed Jan 29 17:55:40 2014 -0500

----------------------------------------------------------------------
 .../apache/accumulo/server/util/MetadataTableUtil.java   | 11 +++++++++--
 .../org/apache/accumulo/master/FateServiceHandler.java   |  2 +-
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/d4c9ee1c/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index bc80b9e..8b8a3d6 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -674,7 +674,10 @@ public class MetadataTableUtil {
   }
 
   private static Scanner createCloneScanner(String tableId, Connector conn) throws TableNotFoundException
{
-    Scanner mscanner = new IsolatedScanner(conn.createScanner(MetadataTable.NAME, Authorizations.EMPTY));
+    String tableName = MetadataTable.NAME;
+    if (tableId.equals(MetadataTable.ID))
+      tableName = RootTable.NAME;
+    Scanner mscanner = new IsolatedScanner(conn.createScanner(tableName, Authorizations.EMPTY));
     mscanner.setRange(new KeyExtent(new Text(tableId), null, null).toMetadataRange());
     mscanner.fetchColumnFamily(DataFileColumnFamily.NAME);
     mscanner.fetchColumnFamily(TabletsSection.CurrentLocationColumnFamily.NAME);
@@ -686,7 +689,11 @@ public class MetadataTableUtil {
   }
 
   static void initializeClone(String srcTableId, String tableId, Connector conn, BatchWriter
bw) throws TableNotFoundException, MutationsRejectedException {
-    TabletIterator ti = new TabletIterator(createCloneScanner(srcTableId, conn), new KeyExtent(new
Text(srcTableId), null, null).toMetadataRange(), true, true);
+    TabletIterator ti;
+    if (srcTableId.equals(MetadataTable.ID))
+      ti = new TabletIterator(createCloneScanner(srcTableId, conn), new Range(), true, true);
+    else
+      ti = new TabletIterator(createCloneScanner(srcTableId, conn), new KeyExtent(new Text(srcTableId),
null, null).toMetadataRange(), true, true);
 
     if (!ti.hasNext())
       throw new RuntimeException(" table deleted during clone?  srcTableId = " + srcTableId);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/d4c9ee1c/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
b/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
index afcda86..3a14ca2 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/FateServiceHandler.java
@@ -170,7 +170,7 @@ class FateServiceHandler implements FateService.Iface {
       }
       case TABLE_CLONE: {
         TableOperation tableOp = TableOperation.CLONE;
-        String srcTableId = validateTableIdArgument(arguments.get(0), tableOp, null);
+        String srcTableId = validateTableIdArgument(arguments.get(0), tableOp, Tables.NOT_ROOT_ID);
         String tableName = validateTableNameArgument(arguments.get(1), tableOp, Tables.NOT_SYSTEM);
 
         if (!master.security.canCloneTable(c, srcTableId, tableName))


Mime
View raw message