busbey opened a new pull request #4000:
URL: https://github.com/apache/hbase/pull/4000


   Since Ruby's getoptlong library can't handle config definitions of the form 
`-Dkey=value`, we preprocess all args to pull out config definitions.
   
   After that preprocessing, the remaining changes correct our use of the 
getoptlong library so we have the same cli handling as prior to using the 
getoptlong library.
   
   Local testing, see HBASE-26543 for previous behavior:
   
   ```
   (base) sbusbey@Seans-MacBook-Pro hbase-3.0.0-alpha-3-SNAPSHOT % cat ~/.irbrc 
   puts "reading from ~/.irbrc"
   (base) sbusbey@Seans-MacBook-Pro hbase-3.0.0-alpha-3-SNAPSHOT % cat 
../tmp/rely_on_argv.rb 
   if ARGV.length > 0
     puts "Pulled out cli option for use in script: #{ARGV.shift}"
   end
   (base) sbusbey@Seans-MacBook-Pro hbase-3.0.0-alpha-3-SNAPSHOT % ./bin/hbase 
shell ../tmp/rely_on_argv.rb foobar
   2022-01-04T17:35:26,106 WARN  [main] util.NativeCodeLoader: Unable to load 
native-hadoop library for your platform... using builtin-java classes where 
applicable
   Pulled out cli option for use in script: foobar
   
   HBase Shell
   Use "help" to get list of supported commands.
   Use "exit" to quit this interactive shell.
   For Reference, please visit: http://hbase.apache.org/book.html#shell
   Version 3.0.0-alpha-3-SNAPSHOT, r898b1695e92e89d22d60da69f3c662555ec1eb0a, 
Mon Jan  3 19:56:35 CST 2022
   Took 0.0010 seconds                                                          
                                                                                
                                                                                
   
   reading from ~/.irbrc
   hbase:001:0> exit
   (base) sbusbey@Seans-MacBook-Pro hbase-3.0.0-alpha-3-SNAPSHOT % ./bin/hbase 
shell ../tmp/rely_on_argv.rb foobar -f
   2022-01-04T17:36:06,137 WARN  [main] util.NativeCodeLoader: Unable to load 
native-hadoop library for your platform... using builtin-java classes where 
applicable
   Pulled out cli option for use in script: foobar
   
   HBase Shell
   Use "help" to get list of supported commands.
   Use "exit" to quit this interactive shell.
   For Reference, please visit: http://hbase.apache.org/book.html#shell
   Version 3.0.0-alpha-3-SNAPSHOT, r898b1695e92e89d22d60da69f3c662555ec1eb0a, 
Mon Jan  3 19:56:35 CST 2022
   Took 0.0011 seconds                                                          
                                                                                
                                                                                
   
   hbase:001:0> exit
   (base) sbusbey@Seans-MacBook-Pro hbase-3.0.0-alpha-3-SNAPSHOT % ./bin/hbase 
shell -D cats=dee -Dfoo=bar  ../tmp/rely_on_argv.rb foobar -f 
   2022-01-04T17:36:41,621 WARN  [main] util.NativeCodeLoader: Unable to load 
native-hadoop library for your platform... using builtin-java classes where 
applicable
   Pulled out cli option for use in script: foobar
   
   HBase Shell
   Use "help" to get list of supported commands.
   Use "exit" to quit this interactive shell.
   For Reference, please visit: http://hbase.apache.org/book.html#shell
   Version 3.0.0-alpha-3-SNAPSHOT, r898b1695e92e89d22d60da69f3c662555ec1eb0a, 
Mon Jan  3 19:56:35 CST 2022
   Took 0.0009 seconds                                                          
                                                                                
                                                                                
   
   hbase:001:0> p @hbase.configuration.get 'foo'
   "bar"
   => "bar"
   hbase:002:0> p @hbase.configuration.get 'cats'
   "dee"
   => "dee"
   hbase:003:0> exit
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to