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-11686 Shell code should create a binding / irb workspace instead of polluting the root namespace #2141

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

bitoffdev
Copy link
Contributor

@bitoffdev bitoffdev commented Jul 24, 2020

Resolves https://issues.apache.org/jira/browse/HBASE-11686

Goal

Stop defining HBase commands and constants on Ruby's main object. Instead, HBase commands and constants are defined within the scope of an Interactive Ruby (IRB) Workspace.

Consequences for Scripts

When using script via STDIN (echo version | hbase shell) or filename (hbase shell script.rb), the code is evaluated by this PR within the created IRB Workspace. Code should work as before unless the script "breaks out" of the current binding (for example, this could be done using Ruby's TOPLEVEL_BINDING). For cases like this one, I added a flag --top-level-defs that should be backwards compatible with all scripts.

Changelog

  • Refactor Shell.export_commands to define commands as singleton methods
    using ruby lambdas. Additionally, this change stores a reference to shell_inst
    in scope so that we no longer need to assume the existance of the variable
    @shell.
  • Add logic to Shell class for constructing an IRB workspace with its own
    binding and non-global receiver. This workspace is loaded with all HBase and
    IRB commands.
  • Create new method on Shell for evaluating input from an arbitrary IO instance
    within the created IRB workspace. This is based on work by Hsieh that was
    previously in bin/hirb.rb. This method is more generic and more testable.
    This single pattern can be used for both executing files and reading from
    stdin, therefore reducing complexity.
  • Move special 'help' and 'tools' command definitions to shell.rb. These
    commands are tightly linked with an instance of the shell, so it is easiest
    to have them defined together.
  • Remove all global includes of HBaseConstants from ruby test files. Before
    this change, tests were loading these constants into the top level, which
    could cause tests to pass that should really fail.
  • Try to reduce the number of places that constants are included. I think it's
    best to reference each ruby constant's full name, but where that would cause
    a big diff I instead moved the include to the innermost Module or Class.
  • Update docs and comments
  • Remove unneccessary includes
  • Add shell --top-level-defs compatibility flag. Since this PR removes all the
    HBase symbols from the top-level receiver (ie. main Object), it is possible
    (albeit unlikely) that this will break operator scripts. This flag will
    export all the commands at the top-level like the shell previously did.
  • Create new helper method Shell::Shell#export_all to install @hbase, @shell,
    constants, and all hbase commands to a target receiver. As a result, the
    HBaseReceiver became very simple and could be moved to shell.rb.
  • Add unit tests for Shell::Shell#eval_io and Shell::Shell#export_all

…d of polluting the root namespace

- Refactor Shell.export_commands to define commands using ruby lambdas.
  Additionally, this change stores a reference to shell_inst in scope so that
  we no longer need to assume the existance of the variable @shell.
- Add logic to Shell class for constructing an IRB workspace with its own
  binding and non-global receiver. This workspace is loaded with all HBase and
  IRB commands.
- Create new method on Shell for evaluating input from an arbitrary IO instance
  within the created IRB workspace. This is based on work by Hsieh that was
  previously in bin/hirb.rb. This method is more generic and more testable.
  This single pattern can be used for both executing files and reading from
  stdin, therefore reducing complexity.
- Move special 'help' and 'tools' command definitions to shell.rb. These
  commands are tightly linked with an instance of the shell, so it is easiest
  to have them defined together.
- Remove all global includes of HBaseConstants from ruby test files. Before
  this change, tests were loading these constants into the top level, which
  could cause tests to pass that should really fail.
- Try to reduce the number of places that constants are included. I think it's
  best to reference each ruby constant's full name, but where that would cause
  a big diff I instead moved the include to the innermost Module or Class.
- Update docs and comments
- Remove unneccessary includes
- Add shell --top-level-cmds compatibility flag. Since this PR removes all the
  HBase symbols from the top-level receiver (ie. main Object), it is possible
  (albeit unlikely) that this will break operator scripts. This flag will
  export all the commands at the top-level like the shell previously did.
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 26s Maven dependency ordering for branch
_ Patch Compile Tests _
+0 🆗 mvndep 0m 7s Maven dependency ordering for patch
-0 ⚠️ rubocop 1m 32s The patch generated 31 new + 1770 unchanged - 27 fixed = 1801 total (was 1797)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
4m 24s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #2141
Optional Tests dupname asflicense rubocop
uname Linux faad208bbbee 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 975cdf7
rubocop https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 52 (vs. ulimit of 12500)
modules C: . hbase-shell U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) rubocop=0.80.0
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 21s 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 _
+0 🆗 mvndep 0m 22s Maven dependency ordering for branch
+1 💚 mvninstall 4m 37s master passed
-0 ⚠️ javadoc 0m 16s root in master failed.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for patch
+1 💚 mvninstall 4m 21s the patch passed
-0 ⚠️ javadoc 0m 14s root in the patch failed.
_ Other Tests _
-1 ❌ unit 233m 25s root in the patch failed.
246m 27s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux f0d3b70732de 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 975cdf7
Default Java 2020-01-14
javadoc https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-root.txt
javadoc https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-root.txt
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-root.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/testReport/
Max. process+thread count 4544 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 32s 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 _
+0 🆗 mvndep 0m 27s Maven dependency ordering for branch
+1 💚 mvninstall 3m 48s master passed
+1 💚 javadoc 2m 14s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for patch
+1 💚 mvninstall 3m 26s the patch passed
+1 💚 javadoc 2m 20s the patch passed
_ Other Tests _
-1 ❌ unit 323m 25s root in the patch failed.
339m 14s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux fd4e3dfff5ea 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 975cdf7
Default Java 1.8.0_232
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-root.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/testReport/
Max. process+thread count 5193 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-2141/1/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

- Fixes some constants references by admin test 2
- Install HBase commands as singleton methods on recevier instances so that
  multiple receivers may exist.
- Rename new flag from --top-level-cmds to --top-level-defs to be more
  semantically accurate.
- Create new helper method Shell::Shell#export_all to install @hbase, @shell,
  constants, and all hbase commands to a target receiver. As a result, the
  HBaseReceiver became very simple and could be moved to shell.rb.
- Add unit tests for Shell::Shell#eval_io and Shell::Shell#export_all
- Add @hbase and @shell to hbase-shell IRB workspace
- Fix robocop issues within patch
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 16s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 21s Maven dependency ordering for branch
_ Patch Compile Tests _
+0 🆗 mvndep 0m 7s Maven dependency ordering for patch
-0 ⚠️ rubocop 1m 35s The patch generated 25 new + 1781 unchanged - 33 fixed = 1806 total (was 1814)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 22s The patch does not generate ASF License warnings.
4m 49s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #2141
Optional Tests dupname asflicense rubocop
uname Linux 43175acd36f0 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 82d0990
rubocop https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 47 (vs. ulimit of 12500)
modules C: . hbase-shell U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) rubocop=0.80.0
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 58s 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 _
+0 🆗 mvndep 0m 24s Maven dependency ordering for branch
+1 💚 mvninstall 4m 58s master passed
+1 💚 javadoc 2m 53s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 15s Maven dependency ordering for patch
+1 💚 mvninstall 4m 32s the patch passed
+1 💚 javadoc 3m 1s the patch passed
_ Other Tests _
-1 ❌ unit 21m 2s root in the patch failed.
40m 46s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux 158d629792ac 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 / 82d0990
Default Java 1.8.0_232
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-root.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/testReport/
Max. process+thread count 1013 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

Copy link
Contributor

@saintstack saintstack left a comment

Choose a reason for hiding this comment

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

Excellent

@busbey FYI

bin/hirb.rb Outdated Show resolved Hide resolved
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 1s 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 _
+0 🆗 mvndep 0m 22s Maven dependency ordering for branch
+1 💚 mvninstall 4m 13s master passed
-0 ⚠️ javadoc 0m 18s root in master failed.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 4m 3s the patch passed
-0 ⚠️ javadoc 0m 17s root in the patch failed.
_ Other Tests _
+1 💚 unit 175m 27s root in the patch passed.
189m 41s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux 31bf89fb04ac 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 82d0990
Default Java 2020-01-14
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-root.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-root.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/testReport/
Max. process+thread count 6846 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/2/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 8s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for branch
_ Patch Compile Tests _
+0 🆗 mvndep 0m 6s Maven dependency ordering for patch
-0 ⚠️ rubocop 1m 33s The patch generated 25 new + 1781 unchanged - 33 fixed = 1806 total (was 1814)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
_ Other Tests _
+1 💚 asflicense 0m 18s The patch does not generate ASF License warnings.
4m 20s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #2141
Optional Tests dupname asflicense rubocop
uname Linux cc5687d9bdce 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 82d0990
rubocop https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count 43 (vs. ulimit of 12500)
modules C: . hbase-shell U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) rubocop=0.80.0
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 3s 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 _
+0 🆗 mvndep 0m 14s Maven dependency ordering for branch
+1 💚 mvninstall 3m 56s master passed
-0 ⚠️ javadoc 0m 17s root in master failed.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 3m 56s the patch passed
-0 ⚠️ javadoc 0m 16s root in the patch failed.
_ Other Tests _
+1 💚 unit 174m 42s root in the patch passed.
188m 51s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux 18500f46ea44 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 82d0990
Default Java 2020-01-14
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-jdk11-hadoop3-check/output/branch-javadoc-root.txt
javadoc https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-jdk11-hadoop3-check/output/patch-javadoc-root.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/testReport/
Max. process+thread count 6751 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 4s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for branch
+1 💚 mvninstall 3m 23s master passed
+1 💚 javadoc 2m 16s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 3m 33s the patch passed
+1 💚 javadoc 2m 27s the patch passed
_ Other Tests _
-1 ❌ unit 331m 47s root in the patch failed.
347m 31s
Subsystem Report/Notes
Docker Client=19.03.12 Server=19.03.12 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #2141
Optional Tests javac javadoc unit
uname Linux f8d2dd72ee60 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 / 82d0990
Default Java 1.8.0_232
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-root.txt
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/testReport/
Max. process+thread count 6111 (vs. ulimit of 12500)
modules C: hbase-shell . U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2141/3/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@saintstack saintstack merged commit 7eff07d into apache:master Jul 28, 2020
@saintstack
Copy link
Contributor

Failures are in the abandoned backup module.

asfgit pushed a commit that referenced this pull request Oct 14, 2020
…d of polluting the root namespace (#2141)

* HBASE-11686 Shell code should create a binding / irb workspace instead of polluting the root namespace

- Refactor Shell.export_commands to define commands using ruby lambdas.
  Additionally, this change stores a reference to shell_inst in scope so that
  we no longer need to assume the existance of the variable @shell.
- Add logic to Shell class for constructing an IRB workspace with its own
  binding and non-global receiver. This workspace is loaded with all HBase and
  IRB commands.
- Create new method on Shell for evaluating input from an arbitrary IO instance
  within the created IRB workspace. This is based on work by Hsieh that was
  previously in bin/hirb.rb. This method is more generic and more testable.
  This single pattern can be used for both executing files and reading from
  stdin, therefore reducing complexity.
- Move special 'help' and 'tools' command definitions to shell.rb. These
  commands are tightly linked with an instance of the shell, so it is easiest
  to have them defined together.
- Remove all global includes of HBaseConstants from ruby test files. Before
  this change, tests were loading these constants into the top level, which
  could cause tests to pass that should really fail.
- Try to reduce the number of places that constants are included. I think it's
  best to reference each ruby constant's full name, but where that would cause
  a big diff I instead moved the include to the innermost Module or Class.
- Update docs and comments
- Remove unneccessary includes
- Add shell --top-level-cmds compatibility flag. Since this PR removes all the
  HBase symbols from the top-level receiver (ie. main Object), it is possible
  (albeit unlikely) that this will break operator scripts. This flag will
  export all the commands at the top-level like the shell previously did.

* HBASE-11686 Light refactoring with added unit tests

- Fixes some constants references by admin test 2
- Install HBase commands as singleton methods on recevier instances so that
  multiple receivers may exist.
- Rename new flag from --top-level-cmds to --top-level-defs to be more
  semantically accurate.
- Create new helper method Shell::Shell#export_all to install @hbase, @shell,
  constants, and all hbase commands to a target receiver. As a result, the
  HBaseReceiver became very simple and could be moved to shell.rb.
- Add unit tests for Shell::Shell#eval_io and Shell::Shell#export_all
- Add @hbase and @shell to hbase-shell IRB workspace
- Fix robocop issues within patch

* Typo s/is/if/

(cherry picked from commit 7eff07d)
clarax pushed a commit to clarax/hbase that referenced this pull request Nov 15, 2020
…d of polluting the root namespace (apache#2141)

* HBASE-11686 Shell code should create a binding / irb workspace instead of polluting the root namespace

- Refactor Shell.export_commands to define commands using ruby lambdas.
  Additionally, this change stores a reference to shell_inst in scope so that
  we no longer need to assume the existance of the variable @shell.
- Add logic to Shell class for constructing an IRB workspace with its own
  binding and non-global receiver. This workspace is loaded with all HBase and
  IRB commands.
- Create new method on Shell for evaluating input from an arbitrary IO instance
  within the created IRB workspace. This is based on work by Hsieh that was
  previously in bin/hirb.rb. This method is more generic and more testable.
  This single pattern can be used for both executing files and reading from
  stdin, therefore reducing complexity.
- Move special 'help' and 'tools' command definitions to shell.rb. These
  commands are tightly linked with an instance of the shell, so it is easiest
  to have them defined together.
- Remove all global includes of HBaseConstants from ruby test files. Before
  this change, tests were loading these constants into the top level, which
  could cause tests to pass that should really fail.
- Try to reduce the number of places that constants are included. I think it's
  best to reference each ruby constant's full name, but where that would cause
  a big diff I instead moved the include to the innermost Module or Class.
- Update docs and comments
- Remove unneccessary includes
- Add shell --top-level-cmds compatibility flag. Since this PR removes all the
  HBase symbols from the top-level receiver (ie. main Object), it is possible
  (albeit unlikely) that this will break operator scripts. This flag will
  export all the commands at the top-level like the shell previously did.

* HBASE-11686 Light refactoring with added unit tests

- Fixes some constants references by admin test 2
- Install HBase commands as singleton methods on recevier instances so that
  multiple receivers may exist.
- Rename new flag from --top-level-cmds to --top-level-defs to be more
  semantically accurate.
- Create new helper method Shell::Shell#export_all to install @hbase, @shell,
  constants, and all hbase commands to a target receiver. As a result, the
  HBaseReceiver became very simple and could be moved to shell.rb.
- Add unit tests for Shell::Shell#eval_io and Shell::Shell#export_all
- Add @hbase and @shell to hbase-shell IRB workspace
- Fix robocop issues within patch

* Typo s/is/if/

(cherry picked from commit 7eff07d)
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.

3 participants