This is an automated email from the ASF dual-hosted git repository.
kturner pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 4a59aa0fc7 removes failure dir from importdir shell command (#5049)
4a59aa0fc7 is described below
commit 4a59aa0fc770bb4a491259307db458d39d537906
Author: Keith Turner <[email protected]>
AuthorDate: Sun Nov 10 13:46:45 2024 -0500
removes failure dir from importdir shell command (#5049)
---
.../shell/commands/ImportDirectoryCommand.java | 28 +++++-----------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git
a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
index 80117d0bfc..5411098dfd 100644
---
a/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
+++
b/shell/src/main/java/org/apache/accumulo/shell/commands/ImportDirectoryCommand.java
@@ -52,38 +52,22 @@ public class ImportDirectoryCommand extends Command {
final boolean ignore = OptUtil.getIgnoreEmptyDirOpt(cl, shellState);
String[] args = cl.getArgs();
- boolean setTime;
- String dir = args.length > 0 ? args[0] : "";
+ String dir = args[0];
+ boolean setTime = Boolean.parseBoolean(cl.getArgs()[1]);
int status = 0;
-
- switch (args.length) {
- case 2: {
- // new bulk import only takes 2 args
- setTime = Boolean.parseBoolean(cl.getArgs()[1]);
-
shellState.getAccumuloClient().tableOperations().importDirectory(dir).to(tableName)
- .tableTime(setTime).ignoreEmptyDir(ignore).load();
- break;
- }
- default: {
- shellState.printException(new IllegalArgumentException(String.format(
- "Expected 2 arguments. There %s %d.", args.length == 1 ? "was" :
"were", args.length)));
- printHelp(shellState);
- status = 1;
- break;
- }
- }
-
+
shellState.getAccumuloClient().tableOperations().importDirectory(dir).to(tableName)
+ .tableTime(setTime).ignoreEmptyDir(ignore).load();
return status;
}
@Override
public int numArgs() {
- return Shell.NO_FIXED_ARG_LENGTH_CHECK;
+ return 2;
}
@Override
public String usage() {
- return getName() + " <directory> [failureDirectory] true|false";
+ return getName() + " <directory> true|false";
}
@Override