Skip to content

stop removing backslashes in shell#5856

Merged
keith-turner merged 2 commits intoapache:2.1from
keith-turner:accumulo-3367
Sep 5, 2025
Merged

stop removing backslashes in shell#5856
keith-turner merged 2 commits intoapache:2.1from
keith-turner:accumulo-3367

Conversation

@keith-turner
Copy link
Copy Markdown
Contributor

fixes #3367

@keith-turner keith-turner added this to the 2.1.5 milestone Sep 3, 2025
@keith-turner
Copy link
Copy Markdown
Contributor Author

keith-turner commented Sep 3, 2025

Created this as a draft because I am not sure what functionality this might break in jshell. Also this changes shell behavior that has been different since 2.1.0. Test this and it does work, the jline line reader no longer turns \x00 into x00

Comment thread shell/src/main/java/org/apache/accumulo/shell/Shell.java Outdated
@keith-turner
Copy link
Copy Markdown
Contributor Author

Reworked this in commit 82900a9 to make Accumulo look for the jline option and set it.

Test that commit by inserting the following data in jshell.

jshell> client.tableOperations().create("test"); var writer=client.createBatchWriter("test"); Mutation m = new Mutation("r1"); m.at().family(new byte[]{'a',0,'b'}).qualifier("q").put("v1"); writer.addMutation(m); writer.close();

Then made the following change in accumulo-env.sh

JAVA_OPTS=(
  '-XX:OnOutOfMemoryError=kill -9 %p'
  '-XX:-OmitStackTraceInFastThrow'
  '-Djava.net.preferIPv4Stack=true'
  '-Dorg.jline.reader.props.disable-event-expansion=on'
  "-Daccumulo.native.lib.path=${lib}/native"
  "${accumulo_initial_opts[@]}"
)

After that, ran the shell and jline is no longer removing \

root@uno> scan -t test -c a\x00b
r1 a\x00b:q []	v1

@keith-turner keith-turner marked this pull request as ready for review September 4, 2025 21:10
@keith-turner keith-turner merged commit 7340efa into apache:2.1 Sep 5, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accumulo 2 shell scans require escape characters where Accumulo 1 did not

2 participants