ctubbsii 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_r400405894
##########
File path:
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1477,6 +1479,47 @@ public Text getMaxRow(String tableName, Authorizations
auths, Text startRow,
return finalUsages;
}
+ /**
+ * Search multiple directories for exportMetadata.zip, the control file used
for the importable
+ * command.
+ *
+ * @param context
+ * used to obtain filesystem based on configuration
+ * @param importDirs
+ * the list of directories to search.
+ * @return the Path representing the location of the file.
+ * @throws AccumuloException
+ * if zero or more than one copy of the exportMetadata.zip file
are found in the
+ * directories provided.
+ */
+ public static Path findExportFile(ClientContext context, String[] importDirs)
+ throws AccumuloException {
+ LinkedHashSet<Path> exportFiles = new LinkedHashSet<>();
+ for (String importDir : importDirs) {
+ Path exportFilePath = null;
+ try {
+ FileSystem fs = new
Path(importDir).getFileSystem(context.getHadoopConf());
+ exportFilePath = new Path(importDir, Constants.EXPORT_FILE);
+ if (fs.exists(exportFilePath)) {
+ exportFiles.add(exportFilePath);
+ }
+ } catch (IOException ioe) {
+ log.warn("Non-Fatal IOException reading export file: {}",
exportFilePath, ioe);
Review comment:
I think I would be confused by this log message. How do you know it's
non-fatal? And, what level of concern should I have as a user to address it?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services