accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject [1/2] git commit: ACCUMULO-2013 - fixing errors when cloning table
Date Mon, 16 Dec 2013 18:19:12 GMT
Updated Branches:
  refs/heads/master 61e48e6b8 -> 98e3df21d


ACCUMULO-2013 - fixing errors when cloning table


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

Branch: refs/heads/master
Commit: 1291713b89b9bd41326d0b4b0cf741fcb29b896a
Parents: 7a6fd95
Author: John Vines <jvines@gmail.com>
Authored: Mon Dec 16 13:18:19 2013 -0500
Committer: John Vines <jvines@gmail.com>
Committed: Mon Dec 16 13:18:19 2013 -0500

----------------------------------------------------------------------
 .../java/org/apache/accumulo/server/tables/TableManager.java    | 5 ++++-
 .../java/org/apache/accumulo/master/tableOps/CloneTable.java    | 4 +---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/1291713b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
index dc154d7..8a5a682 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/tables/TableManager.java
@@ -185,9 +185,12 @@ public class TableManager {
     updateTableStateCache(tableId);
   }
 
-  public void cloneTable(String srcTable, String tableId, String tableName, Map<String,String>
propertiesToSet, Set<String> propertiesToExclude,
+  public void cloneTable(String srcTable, String tableId, String tableName, String namespaceId,
Map<String,String> propertiesToSet, Set<String> propertiesToExclude,
       NodeExistsPolicy existsPolicy) throws KeeperException, InterruptedException {
     prepareNewTableState(instance.getInstanceID(), tableId, tableName, TableState.NEW, existsPolicy);
+    
+    addNamespaceToTable(tableId, namespaceId);
+    
     String srcTablePath = Constants.ZROOT + "/" + instance.getInstanceID() + Constants.ZTABLES
+ "/" + srcTable + Constants.ZTABLE_CONF;
     String newTablePath = Constants.ZROOT + "/" + instance.getInstanceID() + Constants.ZTABLES
+ "/" + tableId + Constants.ZTABLE_CONF;
     ZooReaderWriter.getRetryingInstance().recursiveCopyPersistent(srcTablePath, newTablePath,
NodeExistsPolicy.OVERWRITE);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/1291713b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneTable.java
----------------------------------------------------------------------
diff --git a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneTable.java
b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneTable.java
index 534a6c8..fae2c3b 100644
--- a/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneTable.java
+++ b/server/master/src/main/java/org/apache/accumulo/master/tableOps/CloneTable.java
@@ -157,12 +157,10 @@ class CloneZookeeper extends MasterRepo {
 
       Utils.checkTableDoesNotExist(instance, cloneInfo.tableName, cloneInfo.tableId, TableOperation.CLONE);
 
-      TableManager.getInstance().cloneTable(cloneInfo.srcTableId, cloneInfo.tableId, cloneInfo.tableName,
cloneInfo.propertiesToSet,
+      TableManager.getInstance().cloneTable(cloneInfo.srcTableId, cloneInfo.tableId, cloneInfo.tableName,
cloneInfo.namespaceId, cloneInfo.propertiesToSet,
           cloneInfo.propertiesToExclude, NodeExistsPolicy.OVERWRITE);
       Tables.clearCache(instance);
 
-      TableManager.getInstance().addNamespaceToTable(cloneInfo.tableId, cloneInfo.namespaceId);
-
       return new CloneMetadata(cloneInfo);
     } finally {
       Utils.tableNameLock.unlock();


Mime
View raw message