Skip to content

HBASE-25841 Add basic jshell support - #3224

Merged
ndimiduk merged 1 commit into
apache:masterfrom
ndimiduk:25841-basic-jshell
May 19, 2021
Merged

HBASE-25841 Add basic jshell support#3224
ndimiduk merged 1 commit into
apache:masterfrom
ndimiduk:25841-basic-jshell

Conversation

@ndimiduk

Copy link
Copy Markdown
Member

No description provided.

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

Doesn't do anything other than adding a jshell command to the shell script entry point. Perhaps we also want to provide a startup script that will automatically import some set of packages/classes?

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@ndimiduk

Copy link
Copy Markdown
MemberAuthor
$ JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home ./bin/hbase jshell
JShell is available only with JDK9 and lated. Detected JDK version is 1.8.0_282-b08.
$ JAVA_HOME=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home ./bin/hbase jshell
| Welcome to JShell -- Version 11.0.10
| For an introduction type: /help intro
jshell> import org.apache.hadoop.hbase.HConstants
jshell> HConstants.MASTER_PORT
$2 ==> "hbase.master.port"
jshell>

@Apache9

Copy link
Copy Markdown
Contributor

Could you please provide some examples on how to make use of this jshell? It is just a standalone process? Not inside a master or regionserver process?

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

Could you please provide some examples on how to make use of this jshell? It is just a standalone process? Not inside a master or regionserver process?

Sure. I see this being as a more advanced feature, maybe a developer feature. I'm not really sure who the intended audience of the jshell is from JDK perspective...

The patch as I've posted provides an interactive environment with HBase classes loaded. It is the equivalent of a Ruby IRB session, without all of the helpful DSL code we have that makes the hbase shell experience. Unlike that IRB, this is a Java language experience, not a Ruby language experience.

This is a stand-alone process that is run by a user on-demand. It does not impact any of our existing daemon processes.

Here's an example of how we might update our examples in the book from being code snippets to being jshell snippets,

$ ./bin/hbase jshell
| Welcome to JShell -- Version 11.0.10
| For an introduction type: /help intro
jshell> import org.apache.hadoop.hbase.client.*;
jshell> ConnectionFactory.createAsyncConnection()
...> .thenApply(AsyncConnection::getAdmin)
...> .thenCompose(AsyncAdmin::getMaster)
...> .get()
2021-05-04T09:00:17,827 WARN [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
$2 ==> localhost,16000,1620143354294

@bharathvbharathv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is useful for quickly debugging class path issues and such (or even small programs) saving the time taken to compile test classes. Handy to have the entire class path loaded into the jvm.

@apurtell

Copy link
Copy Markdown
Contributor

Perhaps we also want to provide a startup script that will automatically import some set of packages/classes?

Yes, it wouldn't be a useful experience otherwise, and so this would save everyone some typing at every start time.

@madrob

Copy link
Copy Markdown
Contributor

Agree that we should specify a startup script with base imports, make sure you include the default imports too though because --startup flag overwrites the default script, not appends.

@ndimiduk
ndimidukforce-pushed the 25841-basic-jshell branch from 7b6c8dd to 89181c9CompareMay 13, 2021 23:27
@ndimiduk

Copy link
Copy Markdown
MemberAuthor

I think I've addresses everyone's concerns. Please give it a spin and let me know if there are other imports we should include by default (for example, I initially considered org.apache.hadoop.conf.Configuration).

I'm still looking into whether we can override the welcome message or add a new entry to the /help command. But I don't think those are critical changes, and I'd be happy to commit this with the features already present.

@ndimiduk

Copy link
Copy Markdown
MemberAuthor

Also, HBASE-25889.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 1sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
2m 9s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#3224
Optional Tests
unameLinux fd5e85931748 4.15.0-142-generic #146-Ubuntu SMP Tue Apr 13 01:11:19 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b65733c
Max. process+thread count50 (vs. ulimit of 30000)
modulesC: . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec2m 24sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
_ Patch Compile Tests _
_ Other Tests _
3m 32s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#3224
Optional Tests
unameLinux 3fd0e084d7f6 4.15.0-136-generic #140-Ubuntu SMP Thu Jan 28 05:20:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b65733c
Max. process+thread count46 (vs. ulimit of 30000)
modulesC: . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 28sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗shelldocs0m 0sShelldocs was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall4m 0smaster passed
+0 🆗refguide3m 29sbranch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
_ Patch Compile Tests _
+1 💚mvninstall3m 41sthe patch passed
+1 💚shellcheck0m 2sThere were no new shellcheck issues.
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+0 🆗refguide3m 19spatch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
_ Other Tests _
+1 💚asflicense0m 18sThe patch does not generate ASF License warnings.
16m 46s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#3224
Optional Testsdupname asflicense shellcheck shelldocs refguide
unameLinux 8d98eee267b1 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / b65733c
refguidehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-general-check/output/branch-site/book.html
refguidehttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-general-check/output/patch-site/book.html
Max. process+thread count78 (vs. ulimit of 30000)
modulesC: . U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versionsgit=2.17.1 maven=3.6.3 shellcheck=0.4.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk
ndimiduk requested review from Apache9, bharathv, madrob and pankaj72981 and removed request for madrobMay 18, 2021 20:43
Signed-off-by: Bharath Vissapragada <bharathv@apache.org>
Signed-off-by: Pankaj Kumar <pankajkumar@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
@ndimiduk
ndimidukforce-pushed the 25841-basic-jshell branch from 89181c9 to 3a75622CompareMay 19, 2021 18:36
@ndimiduk
ndimiduk merged commit fe47557 into apache:masterMay 19, 2021
@ndimiduk
ndimiduk deleted the 25841-basic-jshell branch May 19, 2021 18:37
@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#3224
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versionsgit=2.17.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

2 similar comments
@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#3224
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versionsgit=2.17.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 0sDocker mode activated.
-1 ❌patch0m 3s#3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
SubsystemReport/Notes
GITHUB PR#3224
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versionsgit=2.17.1
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

Sign up for freeto 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.

7 participants

@ndimiduk@Apache-HBase@Apache9@apurtell@madrob@bharathv@pankaj72981