ctubbsii commented on a change in pull request #1579: Closes #1576: Update
importTable with directory list as Set<String>
URL: https://github.com/apache/accumulo/pull/1579#discussion_r404939563
##########
File path:
core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
##########
@@ -1544,22 +1544,29 @@ public static Path findExportFile(ClientContext
context, List<String> importDirs
@Override
public void importTable(String tableName, String importDir)
throws TableExistsException, AccumuloException,
AccumuloSecurityException {
+ importTable(tableName, Set.of(importDir.split(",")));
+ }
+
+ @Override
+ public void importTable(String tableName, Set<String> importDirs)
+ throws TableExistsException, AccumuloException,
AccumuloSecurityException {
checkArgument(tableName != null, "tableName is null");
- checkArgument(importDir != null, "importDir is null");
+ checkArgument(importDirs != null, "importDir is null");
checkArgument(tableName.length() <= MAX_TABLE_NAME_LEN,
"Table name is longer than " + MAX_TABLE_NAME_LEN + " characters");
- List<String> importDirs = new ArrayList<>();
- for (String dir : importDir.split(",")) {
- try {
- importDirs.add(checkPath(dir, "Table", "").toString());
- } catch (IOException e) {
- throw new AccumuloException(e);
+ Set<String> checkedImportDirs = new HashSet<String>();
+ try {
+ for (String s : importDirs) {
+ checkedImportDirs.add(checkPath(s, "Table", "").toString());
}
+ } catch (IOException e) {
+ throw new AccumuloException(e);
}
+ String normedImportDir = StringUtils.join(checkedImportDirs, ",");
try {
- Path exportFilePath = findExportFile(context, importDirs);
+ Path exportFilePath = findExportFile(context, checkedImportDirs);
Review comment:
Since the variable was renamed, there are other places below that need to be
changed from `importDirs` to `checkedImportDirs` as well.
----------------------------------------------------------------
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