This is an automated email from the ASF dual-hosted git repository.
ddanielr pushed a commit to branch 2.1
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/2.1 by this push:
new 2936382707 Adds an option to show experimental properties (#5688)
2936382707 is described below
commit 29363827078ab9a725251a091cea2611db05769b
Author: Daniel Roberts <[email protected]>
AuthorDate: Fri Jun 27 22:22:36 2025 +0000
Adds an option to show experimental properties (#5688)
* Adds an option to show experimental properties
Adds an option to show and filter on experimental properties without
changing the output format or showing them all the time.
* fix paren
---
.../accumulo/shell/commands/ConfigCommand.java | 29 ++++++++++++++++------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git
a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
index 9b1b8e43cf..bb39d87ba8 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ConfigCommand.java
@@ -53,10 +53,19 @@ import org.jline.reader.LineReader;
import com.google.common.collect.ImmutableSortedMap;
public class ConfigCommand extends Command {
- private Option tableOpt, deleteOpt, setOpt, forceOpt, filterOpt,
filterWithValuesOpt,
- disablePaginationOpt, outputFileOpt, namespaceOpt;
-
- private int COL1 = 10, COL2 = 7;
+ private Option tableOpt;
+ private Option deleteOpt;
+ private Option setOpt;
+ private Option forceOpt;
+ private Option filterOpt;
+ private Option filterWithValuesOpt;
+ private Option disablePaginationOpt;
+ private Option outputFileOpt;
+ private Option namespaceOpt;
+ private Option showExpOpt;
+
+ private int COL1 = 10;
+ private int COL2 = 7;
private LineReader reader;
@Override
@@ -80,6 +89,7 @@ public class ConfigCommand extends Command {
reader = shellState.getReader();
boolean force = cl.hasOption(forceOpt);
+ boolean showExp = cl.hasOption(showExpOpt);
final String tableName = cl.getOptionValue(tableOpt.getOpt());
if (tableName != null &&
!shellState.getAccumuloClient().tableOperations().exists(tableName)) {
@@ -309,7 +319,8 @@ public class ConfigCommand extends Command {
if (dfault != null && key.toLowerCase().contains("password")) {
siteVal = sysVal = dfault = curVal = curVal.replaceAll(".", "*");
}
- if (defaults.containsKey(key) &&
!Property.getPropertyByKey(key).isExperimental()) {
+ if (defaults.containsKey(key)
+ && (!Property.getPropertyByKey(key).isExperimental() ||
showExp)) {
printConfLine(output, "default", key, dfault);
printed = true;
}
@@ -327,7 +338,7 @@ public class ConfigCommand extends Command {
// If the user can't see the system configuration, then print the
default
// configuration value if the current namespace value is different
from it.
if (sysVal == null && dfault != null && !dfault.equals(nspVal)
- && !Property.getPropertyByKey(key).isExperimental()) {
+ && (!Property.getPropertyByKey(key).isExperimental() ||
showExp)) {
printConfLine(output, "default", key, dfault);
printed = true;
}
@@ -342,7 +353,7 @@ public class ConfigCommand extends Command {
// If the user can't see the system configuration, then print the
default
// configuration value if the current table value is different from
it.
if (nspVal == null && dfault != null && !dfault.equals(curVal)
- && !Property.getPropertyByKey(key).isExperimental()) {
+ && (!Property.getPropertyByKey(key).isExperimental() ||
showExp)) {
printConfLine(output, "default", key, dfault);
printed = true;
}
@@ -351,7 +362,7 @@ public class ConfigCommand extends Command {
// If the user can't see the system configuration, then print the
default
// configuration value if the current namespace value is different
from it.
if (sysVal == null && dfault != null && !dfault.equals(curVal)
- && !Property.getPropertyByKey(key).isExperimental()) {
+ && (!Property.getPropertyByKey(key).isExperimental() ||
showExp)) {
printConfLine(output, "default", key, dfault);
printed = true;
}
@@ -415,6 +426,7 @@ public class ConfigCommand extends Command {
setOpt = new Option("s", "set", true, "set a per-table property");
forceOpt = new Option("force", "force", false,
"used with set to set a deprecated property without asking");
+ showExpOpt = new Option("show", "show-exp", false, "also show experimental
properties");
filterOpt = new Option("f", "filter", true,
"show only properties that contain this string in their name.");
filterWithValuesOpt = new Option("fv", "filter-with-values", true,
@@ -446,6 +458,7 @@ public class ConfigCommand extends Command {
o.addOption(disablePaginationOpt);
o.addOption(outputFileOpt);
o.addOption(forceOpt);
+ o.addOption(showExpOpt);
return o;
}