Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HBASE-25841 Add basic jshell support #3224

Merged
merged 1 commit into from
May 19, 2021

Conversation

ndimiduk
Copy link
Member

@ndimiduk ndimiduk commented May 3, 2021

No description provided.

@ndimiduk
Copy link
Member Author

ndimiduk commented May 3, 2021

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
Member Author

ndimiduk commented May 3, 2021

$ 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
Contributor

Apache9 commented May 4, 2021

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
Member Author

ndimiduk commented May 4, 2021

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

@ndimiduk ndimiduk requested review from saintstack, busbey and madrob May 4, 2021 16:56
Copy link
Contributor

@bharathv bharathv left a comment

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
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
Contributor

madrob commented May 11, 2021

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 ndimiduk force-pushed the 25841-basic-jshell branch from 7b6c8dd to 89181c9 Compare May 13, 2021 23:27
@ndimiduk
Copy link
Member Author

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
Member Author

Also, HBASE-25889.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 1s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed 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
Subsystem Report/Notes
Docker ClientAPI=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
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b65733c
Max. process+thread count 50 (vs. ulimit of 30000)
modules C: . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 2m 24s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed 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
Subsystem Report/Notes
Docker ClientAPI=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
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b65733c
Max. process+thread count 46 (vs. ulimit of 30000)
modules C: . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 28s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 4m 0s master passed
+0 🆗 refguide 3m 29s branch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 41s the patch passed
+1 💚 shellcheck 0m 2s There were no new shellcheck issues.
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+0 🆗 refguide 3m 19s patch has no errors when building the reference guide. See footer for rendered docs, which you should manually inspect.
_ Other Tests _
+1 💚 asflicense 0m 18s The patch does not generate ASF License warnings.
16m 46s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense shellcheck shelldocs refguide
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / b65733c
refguide https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/artifact/yetus-general-check/output/branch-site/book.html
refguide https://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 count 78 (vs. ulimit of 30000)
modules C: . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/2/console
versions git=2.17.1 maven=3.6.3 shellcheck=0.4.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@ndimiduk ndimiduk requested review from bharathv, pankaj72981, Apache9 and madrob and removed request for madrob May 18, 2021 20:43
Signed-off-by: Bharath Vissapragada <[email protected]>
Signed-off-by: Pankaj Kumar <[email protected]>
Signed-off-by: Duo Zhang <[email protected]>
@ndimiduk ndimiduk force-pushed the 25841-basic-jshell branch from 89181c9 to 3a75622 Compare May 19, 2021 18:36
@ndimiduk ndimiduk merged commit fe47557 into apache:master May 19, 2021
@ndimiduk ndimiduk deleted the 25841-basic-jshell branch May 19, 2021 18:37
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ patch 0m 3s #3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #3224
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versions git=2.17.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

2 similar comments
@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ patch 0m 3s #3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #3224
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versions git=2.17.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 0s Docker mode activated.
-1 ❌ patch 0m 3s #3224 does not apply to master. Rebase required? Wrong Branch? See https://yetus.apache.org/documentation/in-progress/precommit-patchnames for help.
Subsystem Report/Notes
GITHUB PR #3224
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-3224/3/console
versions git=2.17.1
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

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.

7 participants