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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]