accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [accumulo] keith-turner commented on a change in pull request #1060: Closes #1053 add multi-volume support to import table command.
Date Mon, 08 Apr 2019 22:55:58 GMT
keith-turner commented on a change in pull request #1060: Closes #1053 add multi-volume support
to import table command.
URL: https://github.com/apache/accumulo/pull/1060#discussion_r273269530
 
 

 ##########
 File path: server/master/src/main/java/org/apache/accumulo/master/tableOps/tableImport/ImportTable.java
 ##########
 @@ -127,7 +137,50 @@ public void checkVersions(Master env) throws AcceptableThriftTableOperationExcep
 
   @Override
   public void undo(long tid, Master env) throws Exception {
-    Utils.unreserveHdfsDirectory(env, new Path(tableInfo.exportDir).toString(), tid);
+    for (ImportedTableInfo.DirectoryMapping dm : tableInfo.directories) {
+      Utils.unreserveHdfsDirectory(env, new Path(dm.exportDir).toString(), tid);
+    }
+
     Utils.unreserveNamespace(env, tableInfo.namespaceId, tid, false);
   }
+
+  static List<ImportedTableInfo.DirectoryMapping> parseExportDir(String exportDir)
{
+    if (exportDir == null || exportDir.isEmpty()) {
+      return Collections.emptyList();
+    }
+
+    String[] exportDirs = exportDir.split(",");
+    List<ImportedTableInfo.DirectoryMapping> dirs = new ArrayList<>(exportDirs.length);
+    for (String ed : exportDirs) {
+      ImportedTableInfo.DirectoryMapping dir = new ImportedTableInfo.DirectoryMapping();
+      dir.exportDir = ed;
+      dirs.add(dir);
+    }
+    return dirs;
+  }
+
+  Path findExportFile(Master env) throws AcceptableThriftTableOperationException {
+    Path exportFilePath = null;
+    for (ImportedTableInfo.DirectoryMapping dm : tableInfo.directories) {
+      exportFilePath = new Path(dm.exportDir, Constants.EXPORT_FILE);
+      try {
+        if (env.getFileSystem().exists(exportFilePath)) {
+          break;
 
 Review comment:
   Would it make sense to refactor this code a bit so that it ensure there is onle one export
file in all of the dirs?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message