You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2023/04/27 22:27:46 UTC
[accumulo] branch main updated: Remove deprecated scan interpreter and formatter (#3265)
This is an automated email from the ASF dual-hosted git repository.
ctubbsii 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 481dbd5744 Remove deprecated scan interpreter and formatter (#3265)
481dbd5744 is described below
commit 481dbd5744d0a8c3438f522cfc8b8ce8d8cee8e9
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Apr 27 18:27:39 2023 -0400
Remove deprecated scan interpreter and formatter (#3265)
---
.../org/apache/accumulo/core/conf/Property.java | 7 --
.../util/interpret/DefaultScanInterpreter.java | 54 ---------
.../core/util/interpret/ScanInterpreter.java | 41 -------
.../main/java/org/apache/accumulo/shell/Shell.java | 6 +-
.../accumulo/shell/commands/DeleteManyCommand.java | 8 +-
.../accumulo/shell/commands/FormatterCommand.java | 39 -------
.../accumulo/shell/commands/GrepCommand.java | 7 +-
.../shell/commands/InterpreterCommand.java | 45 --------
.../accumulo/shell/commands/MaxRowCommand.java | 6 +-
.../accumulo/shell/commands/ScanCommand.java | 124 +++------------------
.../org/apache/accumulo/test/shell/ShellIT.java | 9 +-
11 files changed, 22 insertions(+), 324 deletions(-)
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/Property.java b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
index 4aa718f03d..e7a7427ebf 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/Property.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/Property.java
@@ -1018,13 +1018,6 @@ public enum Property {
"1.3.5"),
TABLE_FORMATTER_CLASS("table.formatter", DefaultFormatter.class.getName(), PropertyType.STRING,
"The Formatter class to apply on results in the shell", "1.4.0"),
- @Deprecated(since = "2.1.0")
- TABLE_INTERPRETER_CLASS("table.interepreter",
- org.apache.accumulo.core.util.interpret.DefaultScanInterpreter.class.getName(),
- PropertyType.STRING,
- "The ScanInterpreter class to apply on scan arguments in the shell. "
- + "Note that this property is deprecated and will be removed in a future version.",
- "1.5.0"),
TABLE_CLASSLOADER_CONTEXT("table.class.loader.context", "", PropertyType.STRING,
"The context to use for loading per-table resources, such as iterators"
+ " from the configured factory in `general.context.class.loader.factory`.",
diff --git a/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java b/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
deleted file mode 100644
index 25086ff61a..0000000000
--- a/core/src/main/java/org/apache/accumulo/core/util/interpret/DefaultScanInterpreter.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.core.util.interpret;
-
-import org.apache.hadoop.io.Text;
-
-/**
- * @deprecated since 2.1.0 This will be removed in a future version in favor of JShell
- */
-@Deprecated(since = "2.1.0")
-public class DefaultScanInterpreter implements ScanInterpreter {
-
- @Override
- public Text interpretRow(Text row) {
- return row;
- }
-
- @Override
- public Text interpretBeginRow(Text row) {
- return row;
- }
-
- @Override
- public Text interpretEndRow(Text row) {
- return row;
- }
-
- @Override
- public Text interpretColumnFamily(Text cf) {
- return cf;
- }
-
- @Override
- public Text interpretColumnQualifier(Text cq) {
- return cq;
- }
-
-}
diff --git a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java b/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
deleted file mode 100644
index 7cac40ae72..0000000000
--- a/core/src/main/java/org/apache/accumulo/core/util/interpret/ScanInterpreter.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.core.util.interpret;
-
-import org.apache.hadoop.io.Text;
-
-/**
- * A simple interface for creating shell plugins that translate the range and column arguments for
- * the shell's scan command.
- *
- * @deprecated since 2.1.0 This will be removed in a future version in favor of JShell
- */
-@Deprecated(since = "2.1.0")
-public interface ScanInterpreter {
-
- Text interpretRow(Text row);
-
- Text interpretBeginRow(Text row);
-
- Text interpretEndRow(Text row);
-
- Text interpretColumnFamily(Text cf);
-
- Text interpretColumnQualifier(Text cq);
-}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/Shell.java b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
index 0fa7ed0d1d..187ffe3cf5 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/Shell.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/Shell.java
@@ -375,11 +375,9 @@ public class Shell extends ShellOptions implements KeywordExecutable {
rootToken = new Token();
- @SuppressWarnings("deprecation")
Command[] dataCommands = {new DeleteCommand(), new DeleteManyCommand(), new DeleteRowsCommand(),
- new EGrepCommand(), new FormatterCommand(),
- new org.apache.accumulo.shell.commands.InterpreterCommand(), new GrepCommand(),
- new ImportDirectoryCommand(), new InsertCommand(), new MaxRowCommand(), new ScanCommand()};
+ new EGrepCommand(), new FormatterCommand(), new GrepCommand(), new ImportDirectoryCommand(),
+ new InsertCommand(), new MaxRowCommand(), new ScanCommand()};
Command[] debuggingCommands =
{new ClasspathCommand(), new ListScansCommand(), new ListCompactionsCommand(),
new TraceCommand(), new PingCommand(), new ListBulkCommand(), new ListTabletsCommand()};
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
index 5384736b53..f2c21057a6 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/DeleteManyCommand.java
@@ -41,10 +41,6 @@ public class DeleteManyCommand extends ScanCommand {
throws Exception {
final String tableName = OptUtil.getTableOpt(cl, shellState);
- @SuppressWarnings("deprecation")
- final org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter =
- getInterpreter(cl, tableName, shellState);
-
// handle first argument, if present, the authorizations list to
// scan with
final Authorizations auths = getAuths(cl, shellState);
@@ -57,12 +53,12 @@ public class DeleteManyCommand extends ScanCommand {
addScanIterators(shellState, cl, scanner, tableName);
// handle remaining optional arguments
- scanner.setRange(getRange(cl, interpeter));
+ scanner.setRange(getRange(cl));
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
// handle columns
- fetchColumns(cl, scanner, interpeter);
+ fetchColumns(cl, scanner);
// output / delete the records
final BatchWriter writer = shellState.getAccumuloClient().createBatchWriter(tableName,
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
index bf517f45d3..786b4a0fb3 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/FormatterCommand.java
@@ -18,19 +18,12 @@
*/
package org.apache.accumulo.shell.commands;
-import org.apache.accumulo.core.client.AccumuloException;
-import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.util.format.Formatter;
import org.apache.accumulo.shell.Shell;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
public class FormatterCommand extends ShellPluginConfigurationCommand {
- private Option interpeterOption;
-
public FormatterCommand() {
super("formatter", Property.TABLE_FORMATTER_CLASS, "f");
}
@@ -46,36 +39,4 @@ public class FormatterCommand extends ShellPluginConfigurationCommand {
Property.TABLE_FORMATTER_CLASS);
}
- @Override
- public Options getOptions() {
- final Options options = super.getOptions();
-
- interpeterOption = new Option("i", "interpeter", false, "configure class as interpreter also");
-
- options.addOption(interpeterOption);
-
- return options;
- }
-
- @SuppressWarnings("deprecation")
- @Override
- protected void setPlugin(final CommandLine cl, final Shell shellState, final String tableName,
- final String className) throws AccumuloException, AccumuloSecurityException {
- super.setPlugin(cl, shellState, tableName, className);
- if (cl.hasOption(interpeterOption.getOpt())) {
- shellState.getAccumuloClient().tableOperations().setProperty(tableName,
- Property.TABLE_INTERPRETER_CLASS.toString(), className);
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- protected void removePlugin(final CommandLine cl, final Shell shellState, final String tableName)
- throws AccumuloException, AccumuloSecurityException {
- super.removePlugin(cl, shellState, tableName);
- if (cl.hasOption(interpeterOption.getOpt())) {
- shellState.getAccumuloClient().tableOperations().removeProperty(tableName,
- Property.TABLE_INTERPRETER_CLASS.toString());
- }
- }
}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
index f22339c53b..a5975d6e54 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/GrepCommand.java
@@ -50,9 +50,6 @@ public class GrepCommand extends ScanCommand {
throw new MissingArgumentException("No terms specified");
}
final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState);
- @SuppressWarnings("deprecation")
- final org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter =
- getInterpreter(cl, tableName, shellState);
// handle first argument, if present, the authorizations list to
// scan with
@@ -69,7 +66,7 @@ public class GrepCommand extends ScanCommand {
final Authorizations auths = getAuths(cl, shellState);
final BatchScanner scanner =
shellState.getAccumuloClient().createBatchScanner(tableName, auths, numThreads);
- scanner.setRanges(Collections.singletonList(getRange(cl, interpeter)));
+ scanner.setRanges(Collections.singletonList(getRange(cl)));
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
@@ -84,7 +81,7 @@ public class GrepCommand extends ScanCommand {
}
try {
// handle columns
- fetchColumns(cl, scanner, interpeter);
+ fetchColumns(cl, scanner);
// output the records
final FormatterConfig config = new FormatterConfig();
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
deleted file mode 100644
index 57a184a2d7..0000000000
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/InterpreterCommand.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.accumulo.shell.commands;
-
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.util.interpret.ScanInterpreter;
-import org.apache.accumulo.shell.Shell;
-
-/**
- * @deprecated since 2.1.0 This will be removed in a future version
- */
-@Deprecated(since = "2.1.0")
-public class InterpreterCommand extends ShellPluginConfigurationCommand {
-
- public InterpreterCommand() {
- super("interpreter", Property.TABLE_INTERPRETER_CLASS, "i");
- }
-
- @Override
- public String description() {
- return "specifies a scan interpreter to interpret scan range and column arguments";
- }
-
- public static Class<? extends ScanInterpreter> getCurrentInterpreter(final String tableName,
- final Shell shellState) {
- return ShellPluginConfigurationCommand.getPluginClass(tableName, shellState,
- ScanInterpreter.class, Property.TABLE_INTERPRETER_CLASS);
- }
-}
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
index 32eab84c58..044957d02d 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/MaxRowCommand.java
@@ -35,11 +35,7 @@ public class MaxRowCommand extends ScanCommand {
throws Exception {
final String tableName = OptUtil.getTableOpt(cl, shellState);
- @SuppressWarnings("deprecation")
- final org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter =
- getInterpreter(cl, tableName, shellState);
-
- final Range range = getRange(cl, interpeter);
+ final Range range = getRange(cl);
final Authorizations auths = getAuths(cl, shellState);
final Text startRow = range.getStartKey() == null ? null : range.getStartKey().getRow();
final Text endRow = range.getEndKey() == null ? null : range.getEndKey().getRow();
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
index 76337d1b12..2e8a7514d0 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
@@ -26,7 +26,6 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.concurrent.TimeUnit;
-import org.apache.accumulo.core.classloader.ClassLoaderUtil;
import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.IteratorSetting;
@@ -58,7 +57,7 @@ import org.apache.hadoop.io.Text;
public class ScanCommand extends Command {
private Option scanOptAuths, scanOptRow, scanOptColumns, disablePaginationOpt, showFewOpt,
- formatterOpt, interpreterOpt, formatterInterpeterOpt, outputFileOpt, scanOptCf, scanOptCq;
+ outputFileOpt, scanOptCf, scanOptCq;
protected Option timestampOpt;
protected Option profileOpt;
@@ -102,9 +101,6 @@ public class ScanCommand extends Command {
final String tableName = OptUtil.getTableOpt(cl, shellState);
final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState);
- @SuppressWarnings("deprecation")
- final org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter =
- getInterpreter(cl, tableName, shellState);
String classLoaderContext = null;
if (cl.hasOption(contextOpt.getOpt())) {
@@ -121,11 +117,11 @@ public class ScanCommand extends Command {
addScanIterators(shellState, cl, scanner, tableName);
// handle remaining optional arguments
- scanner.setRange(getRange(cl, interpeter));
+ scanner.setRange(getRange(cl));
// handle columns
- fetchColumns(cl, scanner, interpeter);
- fetchColumsWithCFAndCQ(cl, scanner, interpeter);
+ fetchColumns(cl, scanner);
+ fetchColumsWithCFAndCQ(cl, scanner);
// set timeout
scanner.setTimeout(getTimeout(cl), TimeUnit.MILLISECONDS);
@@ -232,65 +228,12 @@ public class ScanCommand extends Command {
}
}
- @Deprecated(since = "2.1.0")
- protected org.apache.accumulo.core.util.interpret.ScanInterpreter getInterpreter(
- final CommandLine cl, final String tableName, final Shell shellState) throws Exception {
-
- Class<? extends org.apache.accumulo.core.util.interpret.ScanInterpreter> clazz = null;
- try {
- if (cl.hasOption(interpreterOpt.getOpt())) {
- Shell.log
- .warn("Scan Interpreter option is deprecated and will be removed in a future version.");
-
- clazz = ClassLoaderUtil.loadClass(cl.getOptionValue(interpreterOpt.getOpt()),
- org.apache.accumulo.core.util.interpret.ScanInterpreter.class);
- } else if (cl.hasOption(formatterInterpeterOpt.getOpt())) {
- Shell.log
- .warn("Scan Interpreter option is deprecated and will be removed in a future version.");
-
- clazz = ClassLoaderUtil.loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()),
- org.apache.accumulo.core.util.interpret.ScanInterpreter.class);
- }
- } catch (ClassNotFoundException e) {
- Shell.log.error("Interpreter class could not be loaded.", e);
- }
-
- if (clazz == null) {
- clazz = InterpreterCommand.getCurrentInterpreter(tableName, shellState);
- }
-
- if (clazz == null) {
- clazz = org.apache.accumulo.core.util.interpret.DefaultScanInterpreter.class;
- }
-
- return clazz.getDeclaredConstructor().newInstance();
- }
-
protected Class<? extends Formatter> getFormatter(final CommandLine cl, final String tableName,
final Shell shellState) throws IOException {
-
- try {
- if (cl.hasOption(formatterOpt.getOpt())) {
- Shell.log.warn("Formatter option is deprecated and will be removed in a future version.");
-
- return shellState.getClassLoader(cl, shellState)
- .loadClass(cl.getOptionValue(formatterOpt.getOpt())).asSubclass(Formatter.class);
- } else if (cl.hasOption(formatterInterpeterOpt.getOpt())) {
- Shell.log.warn("Formatter option is deprecated and will be removed in a future version.");
-
- return shellState.getClassLoader(cl, shellState)
- .loadClass(cl.getOptionValue(formatterInterpeterOpt.getOpt()))
- .asSubclass(Formatter.class);
- }
- } catch (Exception e) {
- Shell.log.error("Formatter class could not be loaded.", e);
- }
-
return shellState.getFormatter(tableName);
}
- protected void fetchColumns(final CommandLine cl, final ScannerBase scanner,
- @SuppressWarnings("deprecation") final org.apache.accumulo.core.util.interpret.ScanInterpreter formatter)
+ protected void fetchColumns(final CommandLine cl, final ScannerBase scanner)
throws UnsupportedEncodingException {
if ((cl.hasOption(scanOptCf.getOpt()) || cl.hasOption(scanOptCq.getOpt()))
@@ -306,24 +249,16 @@ public class ScanCommand extends Command {
for (String a : cl.getOptionValue(scanOptColumns.getOpt()).split(",")) {
final String[] sa = a.split(":", 2);
if (sa.length == 1) {
- @SuppressWarnings("deprecation")
- var interprettedCF = formatter.interpretColumnFamily(new Text(a.getBytes(Shell.CHARSET)));
- scanner.fetchColumnFamily(interprettedCF);
+ scanner.fetchColumnFamily(new Text(a.getBytes(Shell.CHARSET)));
} else {
- @SuppressWarnings("deprecation")
- var interprettedCF =
- formatter.interpretColumnFamily(new Text(sa[0].getBytes(Shell.CHARSET)));
- @SuppressWarnings("deprecation")
- var interprettedCQ =
- formatter.interpretColumnQualifier(new Text(sa[1].getBytes(Shell.CHARSET)));
- scanner.fetchColumn(interprettedCF, interprettedCQ);
+ scanner.fetchColumn(new Text(sa[0].getBytes(Shell.CHARSET)),
+ new Text(sa[1].getBytes(Shell.CHARSET)));
}
}
}
}
- private void fetchColumsWithCFAndCQ(CommandLine cl, Scanner scanner,
- @SuppressWarnings("deprecation") org.apache.accumulo.core.util.interpret.ScanInterpreter interpeter) {
+ private void fetchColumsWithCFAndCQ(CommandLine cl, Scanner scanner) {
String cf = "";
String cq = "";
if (cl.hasOption(scanOptCf.getOpt())) {
@@ -338,24 +273,16 @@ public class ScanCommand extends Command {
scanOptCf.getOpt(), scanOptCq.getOpt());
throw new IllegalArgumentException(formattedString);
} else if (!cf.isEmpty() && cq.isEmpty()) {
- @SuppressWarnings("deprecation")
- var interprettedCF = interpeter.interpretColumnFamily(new Text(cf.getBytes(Shell.CHARSET)));
- scanner.fetchColumnFamily(interprettedCF);
+ scanner.fetchColumnFamily(new Text(cf.getBytes(Shell.CHARSET)));
} else if (!cf.isEmpty() && !cq.isEmpty()) {
- @SuppressWarnings("deprecation")
- var interprettedCF = interpeter.interpretColumnFamily(new Text(cf.getBytes(Shell.CHARSET)));
- @SuppressWarnings("deprecation")
- var interprettedCQ =
- interpeter.interpretColumnQualifier(new Text(cq.getBytes(Shell.CHARSET)));
- scanner.fetchColumn(interprettedCF, interprettedCQ);
+ scanner.fetchColumn(new Text(cf.getBytes(Shell.CHARSET)),
+ new Text(cq.getBytes(Shell.CHARSET)));
}
}
- protected Range getRange(final CommandLine cl,
- @SuppressWarnings("deprecation") final org.apache.accumulo.core.util.interpret.ScanInterpreter formatter)
- throws UnsupportedEncodingException {
+ protected Range getRange(final CommandLine cl) throws UnsupportedEncodingException {
if ((cl.hasOption(OptUtil.START_ROW_OPT) || cl.hasOption(OptUtil.END_ROW_OPT))
&& cl.hasOption(scanOptRow.getOpt())) {
// did not see a way to make commons cli do this check... it has mutually exclusive options
@@ -365,23 +292,10 @@ public class ScanCommand extends Command {
}
if (cl.hasOption(scanOptRow.getOpt())) {
- @SuppressWarnings("deprecation")
- var interprettedRow = formatter
- .interpretRow(new Text(cl.getOptionValue(scanOptRow.getOpt()).getBytes(Shell.CHARSET)));
- return new Range(interprettedRow);
+ return new Range(new Text(cl.getOptionValue(scanOptRow.getOpt()).getBytes(Shell.CHARSET)));
} else {
Text startRow = OptUtil.getStartRow(cl);
- if (startRow != null) {
- @SuppressWarnings("deprecation")
- var interprettedBeginRow = formatter.interpretBeginRow(startRow);
- startRow = interprettedBeginRow;
- }
Text endRow = OptUtil.getEndRow(cl);
- if (endRow != null) {
- @SuppressWarnings("deprecation")
- var interprettedEndRow = formatter.interpretEndRow(endRow);
- endRow = interprettedEndRow;
- }
final boolean startInclusive = !cl.hasOption(optStartRowExclusive.getOpt());
final boolean endInclusive = !cl.hasOption(optEndRowExclusive.getOpt());
return new Range(startRow, startInclusive, endRow, endInclusive);
@@ -432,12 +346,6 @@ public class ScanCommand extends Command {
timestampOpt = new Option("st", "show-timestamps", false, "display timestamps");
disablePaginationOpt = new Option("np", "no-pagination", false, "disable pagination of output");
showFewOpt = new Option("f", "show-few", true, "show only a specified number of characters");
- formatterOpt =
- new Option("fm", "formatter", true, "fully qualified name of the formatter class to use");
- interpreterOpt = new Option("i", "interpreter", true,
- "fully qualified name of the interpreter class to use");
- formatterInterpeterOpt = new Option("fi", "fmt-interpreter", true,
- "fully qualified name of a class that is a formatter and interpreter");
timeoutOption = new Option(null, "timeout", true,
"time before scan should fail if no data is returned. If no unit is"
+ " given assumes seconds. Units d,h,m,s,and ms are supported. e.g. 30s or 100ms");
@@ -456,7 +364,6 @@ public class ScanCommand extends Command {
scanOptCq.setArgName("column-qualifier");
showFewOpt.setRequired(false);
showFewOpt.setArgName("int");
- formatterOpt.setArgName("className");
timeoutOption.setArgName("timeout");
outputFileOpt.setArgName("file");
contextOpt.setArgName("context");
@@ -482,9 +389,6 @@ public class ScanCommand extends Command {
o.addOption(disablePaginationOpt);
o.addOption(OptUtil.tableOpt("table to be scanned"));
o.addOption(showFewOpt);
- o.addOption(formatterOpt);
- o.addOption(interpreterOpt);
- o.addOption(formatterInterpeterOpt);
o.addOption(timeoutOption);
if (Arrays.asList(ScanCommand.class.getName(), GrepCommand.class.getName(),
EGrepCommand.class.getName()).contains(this.getClass().getName())) {
diff --git a/test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java b/test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java
index fa868bccbe..43b288e3b5 100644
--- a/test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/shell/ShellIT.java
@@ -337,10 +337,7 @@ public class ShellIT extends SharedMiniClusterBase {
// delete will show the timestamp
exec("deletemany -r 1 -f -st", true, "[DELETED] 1 1:1 [] 1");
-
- // DeleteManyCommand has its own Formatter (DeleterFormatter), so it does not honor the -fm flag
- exec("deletemany -r 2 -f -st -fm org.apache.accumulo.core.util.format.DateStringFormatter",
- true, "[DELETED] 2 2:2 [] 2");
+ exec("deletemany -r 2 -f -st", true, "[DELETED] 2 2:2 [] 2");
exec("setauths -c ", true);
exec("deletetable test -f", true, "Table: [test] has been deleted");
@@ -419,10 +416,6 @@ public class ShellIT extends SharedMiniClusterBase {
String expectedFew = "1 123:12345 [12345678] 123456789\t12345";
exec("scan -st", true, expected);
exec("scan -st -f 5", true, expectedFew);
- // also prove that BinaryFormatter behaves same as the default
- exec("scan -st -fm org.apache.accumulo.core.util.format.BinaryFormatter", true, expected);
- exec("scan -st -f 5 -fm org.apache.accumulo.core.util.format.BinaryFormatter", true,
- expectedFew);
exec("setauths -c", true);
exec("deletetable test -f", true, "Table: [test] has been deleted");
}