You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "ddanielr (via GitHub)" <gi...@apache.org> on 2023/03/07 21:24:00 UTC

[GitHub] [accumulo] ddanielr commented on a diff in pull request #3228: Fix for #2872. Makes exporttable command volume aware.

ddanielr commented on code in PR #3228:
URL: https://github.com/apache/accumulo/pull/3228#discussion_r1128455086


##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableExport/WriteExportFiles.java:
##########
@@ -186,8 +191,30 @@ public static void exportTable(VolumeManager fs, ServerContext context, String t
       dataOut.close();
       dataOut = null;
 
-      createDistcpFile(fs, exportDir, exportMetaFilePath, uniqueFiles);
+      // make a set of unique volumes from the map
+      for (String fileString : uniqueFiles.values()) {
+        String[] fileSegmentArray = fileString.split("/");
+        for (String fileSegment : fileSegmentArray) {

Review Comment:
   There is no need for the second for-loop or int counter. You can simply access the array at position 3.
   `volumeSet.add(fileSegmentArray[2])`



##########
server/manager/src/main/java/org/apache/accumulo/manager/tableOps/tableExport/WriteExportFiles.java:
##########
@@ -196,12 +223,16 @@ public static void exportTable(VolumeManager fs, ServerContext context, String t
   }
 
   private static void createDistcpFile(VolumeManager fs, String exportDir, Path exportMetaFilePath,
-      Map<String,String> uniqueFiles) throws IOException {
-    BufferedWriter distcpOut = new BufferedWriter(
-        new OutputStreamWriter(fs.create(new Path(exportDir, "distcp.txt")), UTF_8));
+      Set<String> uniqueFiles, String volumeName) throws IOException {
+    if (volumeName.contains(":")) {

Review Comment:
   I would recommend replacing the colon with a hyphen vs selecting a substring. 
   
   If two namenodes exist on the same fqdn but on different ports you would end up writing to the same filepath for both volume locations. 



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org