hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bus...@apache.org
Subject hbase git commit: HBASE-16196 Update to JRuby 9.1.9.0
Date Wed, 31 May 2017 18:07:10 GMT
Repository: hbase
Updated Branches:
  refs/heads/master dda9ae029 -> 140ce1453


HBASE-16196 Update to JRuby 9.1.9.0

* Get hbase-shell to use latest current JRuby release.
* Update license information to reflect the changes to jruby-complete.jar
* Update shell scripts for Ruby 1.8->2.x incompatabilities
* Update joni and jcodings to compatible versions

Signed-off-by: Sean Busbey <busbey@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/140ce145
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/140ce145
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/140ce145

Branch: refs/heads/master
Commit: 140ce1453ec24b5776c26c23fef866406b6344fe
Parents: dda9ae0
Author: Mike Drob <mdrob@apache.org>
Authored: Thu May 18 09:32:40 2017 -0700
Committer: Sean Busbey <busbey@apache.org>
Committed: Wed May 31 11:09:07 2017 -0500

----------------------------------------------------------------------
 bin/draining_servers.rb                         |  12 +-
 bin/get-active-master.rb                        |   8 +-
 bin/region_status.rb                            |  26 ++--
 bin/replication/copy_tables_desc.rb             |  17 ++-
 bin/shutdown_regionserver.rb                    |   6 +-
 .../src/main/resources/META-INF/LICENSE.vm      | 150 +++++--------------
 .../src/main/resources/META-INF/NOTICE.vm       |  41 ++---
 .../src/main/resources/supplemental-models.xml  |   6 +-
 hbase-shell/src/main/ruby/hbase/admin.rb        |  15 +-
 hbase-shell/src/main/ruby/hbase/security.rb     |   2 +-
 hbase-shell/src/main/ruby/hbase_constants.rb    |   6 +-
 hbase-shell/src/main/ruby/irb/hirb.rb           |   2 +-
 hbase-shell/src/main/ruby/shell/commands.rb     |  15 +-
 hbase-shell/src/main/ruby/shell/formatter.rb    |   9 +-
 .../hadoop/hbase/client/AbstractTestShell.java  |   2 +-
 .../hadoop/hbase/client/TestShellNoCluster.java |   2 +-
 .../hbase/client/rsgroup/TestShellRSGroups.java |   2 +-
 hbase-shell/src/test/ruby/hbase/admin_test.rb   |   4 +-
 pom.xml                                         |   7 +-
 19 files changed, 123 insertions(+), 209 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/bin/draining_servers.rb
----------------------------------------------------------------------
diff --git a/bin/draining_servers.rb b/bin/draining_servers.rb
index 6849605..8a615a8 100644
--- a/bin/draining_servers.rb
+++ b/bin/draining_servers.rb
@@ -21,12 +21,12 @@
 require 'optparse'
 include Java
 
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.client.ConnectionFactory
-import org.apache.hadoop.hbase.client.HBaseAdmin
-import org.apache.hadoop.hbase.zookeeper.ZKUtil
-import org.apache.commons.logging.Log
-import org.apache.commons.logging.LogFactory
+java_import org.apache.hadoop.hbase.HBaseConfiguration
+java_import org.apache.hadoop.hbase.client.ConnectionFactory
+java_import org.apache.hadoop.hbase.client.HBaseAdmin
+java_import org.apache.hadoop.hbase.zookeeper.ZKUtil
+java_import org.apache.commons.logging.Log
+java_import org.apache.commons.logging.LogFactory
 
 # Name of this script
 NAME = "draining_servers"

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/bin/get-active-master.rb
----------------------------------------------------------------------
diff --git a/bin/get-active-master.rb b/bin/get-active-master.rb
index f7e1ff6..bd303b3 100644
--- a/bin/get-active-master.rb
+++ b/bin/get-active-master.rb
@@ -18,10 +18,10 @@
 # Prints the hostname of the machine running the active master.
 
 include Java 
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.ServerName
-import org.apache.hadoop.hbase.zookeeper.ZKUtil
-import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
+java_import org.apache.hadoop.hbase.HBaseConfiguration
+java_import org.apache.hadoop.hbase.ServerName
+java_import org.apache.hadoop.hbase.zookeeper.ZKUtil
+java_import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher
 
 # disable debug/info logging on this script for clarity
 log_level = org.apache.log4j.Level::ERROR

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/bin/region_status.rb
----------------------------------------------------------------------
diff --git a/bin/region_status.rb b/bin/region_status.rb
index f889de9..aab7e12 100644
--- a/bin/region_status.rb
+++ b/bin/region_status.rb
@@ -45,19 +45,19 @@ end
 
 require 'java'
 
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.TableName
-import org.apache.hadoop.hbase.HConstants
-import org.apache.hadoop.hbase.MasterNotRunningException
-import org.apache.hadoop.hbase.client.HBaseAdmin
-import org.apache.hadoop.hbase.client.Table
-import org.apache.hadoop.hbase.client.Scan
-import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter
-import org.apache.hadoop.hbase.util.Bytes
-import org.apache.hadoop.hbase.HRegionInfo
-import org.apache.hadoop.hbase.MetaTableAccessor
-import org.apache.hadoop.hbase.HTableDescriptor
-import org.apache.hadoop.hbase.client.ConnectionFactory
+java_import org.apache.hadoop.hbase.HBaseConfiguration
+java_import org.apache.hadoop.hbase.TableName
+java_import org.apache.hadoop.hbase.HConstants
+java_import org.apache.hadoop.hbase.MasterNotRunningException
+java_import org.apache.hadoop.hbase.client.HBaseAdmin
+java_import org.apache.hadoop.hbase.client.Table
+java_import org.apache.hadoop.hbase.client.Scan
+java_import org.apache.hadoop.hbase.filter.FirstKeyOnlyFilter
+java_import org.apache.hadoop.hbase.util.Bytes
+java_import org.apache.hadoop.hbase.HRegionInfo
+java_import org.apache.hadoop.hbase.MetaTableAccessor
+java_import org.apache.hadoop.hbase.HTableDescriptor
+java_import org.apache.hadoop.hbase.client.ConnectionFactory
 
 # disable debug logging on this script for clarity
 log_level = org.apache.log4j.Level::ERROR

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/bin/replication/copy_tables_desc.rb
----------------------------------------------------------------------
diff --git a/bin/replication/copy_tables_desc.rb b/bin/replication/copy_tables_desc.rb
index a7cc3a3..a265bf1 100644
--- a/bin/replication/copy_tables_desc.rb
+++ b/bin/replication/copy_tables_desc.rb
@@ -24,13 +24,14 @@
 #
 
 include Java
-import org.apache.commons.logging.LogFactory
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.HConstants
-import org.apache.hadoop.hbase.client.HBaseAdmin
-import org.apache.hadoop.hbase.HTableDescriptor
-import org.apache.hadoop.conf.Configuration
-import org.apache.hadoop.hbase.client.ConnectionFactory
+java_import org.apache.commons.logging.LogFactory
+java_import org.apache.hadoop.conf.Configuration
+java_import org.apache.hadoop.hbase.HBaseConfiguration
+java_import org.apache.hadoop.hbase.HConstants
+java_import org.apache.hadoop.hbase.HTableDescriptor
+java_import org.apache.hadoop.hbase.TableName
+java_import org.apache.hadoop.hbase.client.ConnectionFactory
+java_import org.apache.hadoop.hbase.client.HBaseAdmin
 
 # Name of this script
 NAME = "copy_tables_desc"
@@ -44,7 +45,7 @@ end
 def copy (src, dst, table)
   # verify if table exists in source cluster
   begin
-    t = src.getTableDescriptor(table.to_java_bytes)
+    t = src.getTableDescriptor(TableName.valueOf(table))
   rescue org.apache.hadoop.hbase.TableNotFoundException
     puts "Source table \"%s\" doesn't exist, skipping." % table
     return

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/bin/shutdown_regionserver.rb
----------------------------------------------------------------------
diff --git a/bin/shutdown_regionserver.rb b/bin/shutdown_regionserver.rb
index 608248f..9d514a7 100644
--- a/bin/shutdown_regionserver.rb
+++ b/bin/shutdown_regionserver.rb
@@ -23,9 +23,9 @@
 #  ./bin/hbase org.jruby.Main bin/shutdown_regionserver.rb c2021:16020
 
 include Java
-import org.apache.hadoop.hbase.HBaseConfiguration
-import org.apache.hadoop.hbase.client.HBaseAdmin
-import org.apache.hadoop.hbase.client.ConnectionFactory
+java_import org.apache.hadoop.hbase.HBaseConfiguration
+java_import org.apache.hadoop.hbase.client.HBaseAdmin
+java_import org.apache.hadoop.hbase.client.ConnectionFactory
 
 def usage(msg=nil)
   $stderr.puts 'Usage: shutdown_regionserver.rb <host:port>..'

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm
----------------------------------------------------------------------
diff --git a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm
index 29dd9d5..96f6bce 100644
--- a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm
+++ b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm
@@ -1349,134 +1349,52 @@ JRuby Incorporated Works
 Some additional libraries distributed with JRuby are not covered by
 JRuby's licence.
 
-## skip bytelist and yydebug because they're covered by the jruby copyright and license
+## skip bytelist, jnr-posix, jruby-openssl, jruby-readline, psych, and yydebug
+## because they're covered by the jruby copyright and license
+
 ## skip rails benchmark javascript, because it's not in the complete jar
-The "rake" library (http://rake.rubyforge.org/) is distributed under
- the MIT license (available above), and has the following copyright:
 
-   Copyright (c) 2003, 2004 Jim Weirich
 ## jruby bundles asm, but we already ref that in our included deps
 
-## joda-time only in NOTICE because it's ASLv2
-## commons-logging in NOTICE because it's ASLv2
- build_lib/apt-mirror-api.jar, build_lib/bnd-0.0.249.jar,
- BSF and ant are distributed under the Apache Software License,
- Version 1.1 (shown below)
+jline2 is distributed under the BSD license (available above) and is
 
---- ASL v1.1 license
-/* ====================================================================
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2000 The Apache Software Foundation.  All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- *    if any, must include the following acknowledgment:
- *       "This product includes software developed by the
- *        Apache Software Foundation (http://www.apache.org/)."
- *    Alternately, this acknowledgment may appear in the software itself,
- *    if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Apache" and "Apache Software Foundation" must
- *    not be used to endorse or promote products derived from this
- *    software without prior written permission. For written
- *    permission, please contact apache@apache.org.
- *
- * 5. Products derived from this software may not be called "Apache",
- *    nor may "Apache" appear in their name, without prior written
- *    permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation.  For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- * Portions of this software are based upon public domain software
- * originally written at the National Center for Supercomputing Applications,
- * University of Illinois, Urbana-Champaign.
- */
---- End ASL v1.1 license
+   Copyright (c) 2002-2012, the original author or authors.
+   All rights reserved.
 
- build_lib/constantine.jar (http://kenai.com/projects/constantine)
-## jruby bundles jcodings and joni, but we already ref that in our included deps
- distributed under the MIT license (available above).
+jzlib is distributed under the BSD license (available above) and is:
 
-## section on ASLv2 incorporated works just in NOTICE
-## skip emma and junit; both aren't in the complete jar
- build_lib/jline-* (http://jline.sourceforge.net) is distributed
- under the following BSD-style license:
+   Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved.
 
-   Redistribution and use in source and binary forms, with or
-   without modification, are permitted provided that the following
-   conditions are met:
+The "rake" library (http://rake.rubyforge.org/) is distributed under
+ the MIT license (available above), and has the following copyright:
 
-   Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
+   Copyright (c) 2003, 2004 Jim Weirich
 
-   Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer
-   in the documentation and/or other materials provided with
-   the distribution.
+## jruby bundles jcodings and joni, but we already ref that in our included deps
 
-   Neither the name of JLine nor the names of its contributors
-   may be used to endorse or promote products derived from this
-   software without specific prior written permission.
+Bouncycastle is released under the MIT license (available above),
+and is Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle.
 
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-   BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-   AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-   EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-   OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-   AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-   OF THE POSSIBILITY OF SUCH DAMAGE.
-
-## I couldn't determine what use of bouncycastle this referred to
-## so I'm not sure if it's included in the jruby-complete jar or not.
- Bouncycastle is released under the MIT license (available above),
- and is Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle.
-
- The "yecht" library is Copyright (c) 2009-2011 Ola Bini, and released
- under the MIT license (available above).
+jnr-x86asm is distributed under the MIT license (available above),
+with the following copyrights:
+
+   Copyright (C) 2010 Wayne Meissner
+   Copyright (c) 2008-2009, Petr Kobalicek <kobalicek.petr@gmail.com>
+
+## The following only in NOTICE because they are all ASLv2
+##   invokebinder, jffi, jitescript, jnr-constants, jnr-enxio, jnr-ffi,
+##   jnr-netdb, jnr-unixsocket, joda-time, maven, nailgun, options,
+##   snakeyaml, unsafe-fences
+
+## Skip racc, json-generator, json-parser because it is under Ruby license
 
 ## jruby bundles jquery, but we already ref that above.
-  most files found in lib/ruby/1.8, lib/ruby/1.9, and lib/ruby/site_ruby/1.8/rubygems*
-  are distributed under The Ruby License's non-GPL provision (available below).
+JRuby distributes some ruby modules which are distributed under Ruby
+license:
 
 Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
-You can redistribute it and/or modify it under either the terms of the GPL
-(see the file GPL), or the conditions below:
+You can redistribute it and/or modify it under either the terms of the
+2-clause BSDL (see the file BSDL), or the conditions below:
 
   1. You may make and give away verbatim copies of the source form of the
      software without restriction, provided that you duplicate all of the
@@ -2574,10 +2492,6 @@ Common Public License - v 1.0
   more than one year after the cause of action arose. Each party waives
  its rights to a jury trial in any resulting litigation.
 #end
-## We put the JRuby incorporated works bits here, since we first reference JRuby in the CPL
section.
-#if($jruby)
-#jruby_license()
-#end
 #if(!(${epl.isEmpty()}))
 ====
 ## print all the EPL 1.0 licensed works
@@ -2833,4 +2747,8 @@ This product includes the following works licensed under the Eclipse
Public Lice
   Agreement more than one year after the cause of action arose. Each
   party waives its rights to a jury trial in any resulting litigation.
 #end
+## We put the JRuby incorporated works bits here, since we first reference JRuby in the EPL
section.
+#if($jruby)
+#jruby_license()
+#end
 #end

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm
----------------------------------------------------------------------
diff --git a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm
index 4be6017..c77ade5 100644
--- a/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm
+++ b/hbase-resource-bundle/src/main/resources/META-INF/NOTICE.vm
@@ -175,38 +175,29 @@ JRuby Incorporated Works
 Some additional libraries distributed with JRuby are not covered by
 JRuby's licence.
 
-## skip bytelist and yydebug because they're covered by the jruby copyright and license
+## skip bytelist, jnr-posix, jruby-openssl, jruby-readline, psych, and yydebug
+## because they're covered by the jruby copyright and license
+
 ## skip rails benchmark javascript, because it's not in the complete jar
-## skip rake because MIT
+
 ## jruby bundles asm, but we already ref that in our included deps
 
- build_lib/apt-mirror-api.jar, build_lib/bnd-0.0.249.jar,
- BSF and ant are distributed under the Apache Software License,
- Version 1.1
+## skip jline2, jzlib because BSD-3
+
+## skip rake because MIT
 
-## skip constantine because MIT
 ## jruby bundles jcodings and joni, but we already ref that in our included deps
 
- build_lib/commons-logging-1.1.1.jar
- build_lib/jarjar-1.0rc8.jar (http://code.google.com/p/jarjar),
- build_lib/joda-time-1.6.2.jar (http://joda-time.sourceforge.net),
- build_lib/jffi*jar (https://github.com/wmeissner/jffi),
- build_lib/jaffl.jar (https://github.com/wmeissner/jaffl),
- build_lib/jnr-netdb.jar (http://github.com/wmeissner/jnr-netdb),
- build_lib/dynalang-0.3.jar (http://dynalang.sourceforge.net),
- build_lib/nailgun-0.7.1.jar and tool/nailgun/ng.exe
- (http://martiansoftware.com/nailgun) are distributed under the
- Apache License version 2.0.
-## skip emma and junit; both aren't in the complete jar
-## skip jline because BSD-3
-## skip bouncy because MIT
-## skip yecht because MIT
-## skip jquery because MIT
-
-  most files found in lib/ruby/1.8, lib/ruby/1.9, and lib/ruby/site_ruby/1.8/rubygems*
-  are distributed under The Ruby License's non-GPL provision, see LICENSE for details and
-  http://jruby.org/ for source.
+## skip Bouncycastle, jnr-x86asm because MIT
+
+ invokebinder, jffi, jitescript, jnr-constants, jnr-enxio, jnr-ffi,
+ jnr-netdb, jnr-unixsocket, joda-time, maven, nailgun, options,
+ snakeyaml, unsafe-fences are distributed under the Apache License
+ version 2.0.
+
+## Skip racc, json-generator, json-parser because it is under Ruby license
 
+## jruby bundles jquery, but we already ref that above.
 #end
 ## first bundled source
 #if(${bundled-logo})

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-resource-bundle/src/main/resources/supplemental-models.xml
----------------------------------------------------------------------
diff --git a/hbase-resource-bundle/src/main/resources/supplemental-models.xml b/hbase-resource-bundle/src/main/resources/supplemental-models.xml
index 708530b..57ce56f 100644
--- a/hbase-resource-bundle/src/main/resources/supplemental-models.xml
+++ b/hbase-resource-bundle/src/main/resources/supplemental-models.xml
@@ -2671,11 +2671,11 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
 
       <licenses>
         <license>
-          <name>Common Public License Version 1.0</name>
-          <url>http://www-128.ibm.com/developerworks/library/os-cpl.html</url>
+          <name>Eclipse Public License 1.0</name>
+          <url>http://www.eclipse.org/legal/epl-v10.html</url>
           <distribution>repo</distribution>
           <comments>
-Copyright (c) 2007-2011 The JRuby project
+Copyright (c) 2007-2017 The JRuby project
 </comments>
         </license>
       </licenses>

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/hbase/admin.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb
index 6a9458b..9739a13 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -76,9 +76,9 @@ module Hbase
       end
 
       begin
-        @admin.compactRegion(table_or_region_name.to_java_bytes, family_bytes, false)
+        @admin.compactRegion(table_or_region_name.to_java_bytes, family_bytes)
       rescue java.lang.IllegalArgumentException => e
-        @admin.compact(TableName.valueOf(table_or_region_name), family_bytes, false, compact_type)
+        @admin.compact(TableName.valueOf(table_or_region_name), family_bytes, compact_type)
       end
     end
 
@@ -472,14 +472,17 @@ module Hbase
     #----------------------------------------------------------------------------------------------
     # Returns table's structure description
     def describe(table_name)
+      tableExists(table_name)
       @admin.getTableDescriptor(TableName.valueOf(table_name)).to_s
     end
 
     def get_column_families(table_name)
+      tableExists(table_name)
       @admin.getTableDescriptor(TableName.valueOf(table_name)).getColumnFamilies()
     end
 
     def get_table_attributes(table_name)
+      tableExists(table_name)
       @admin.getTableDescriptor(TableName.valueOf(table_name)).toStringTableAttributes
     end
 
@@ -868,7 +871,7 @@ module Hbase
       family.setMobEnabled(JBoolean.valueOf(arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::IS_MOB)))
if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::IS_MOB)
       family.setMobThreshold(JLong.valueOf(arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::MOB_THRESHOLD)))
if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::MOB_THRESHOLD)
       if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::BLOOMFILTER)
-        bloomtype = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::BLOOMFILTER).upcase
+        bloomtype = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::BLOOMFILTER).upcase.to_sym
         unless org.apache.hadoop.hbase.regionserver.BloomType.constants.include?(bloomtype)
           raise(ArgumentError, "BloomFilter type #{bloomtype} is not supported. Use one of
" + org.apache.hadoop.hbase.regionserver.StoreFile::BloomType.constants.join(" "))
         else
@@ -876,7 +879,7 @@ module Hbase
         end
       end
       if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION)
-        compression = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION).upcase
+        compression = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION).upcase.to_sym
         unless org.apache.hadoop.hbase.io.compress.Compression::Algorithm.constants.include?(compression)
           raise(ArgumentError, "Compression #{compression} is not supported. Use one of "
+ org.apache.hadoop.hbase.io.compress.Compression::Algorithm.constants.join(" "))
         else
@@ -894,7 +897,7 @@ module Hbase
         end
       end
       if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION_COMPACT)
-        compression = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION_COMPACT).upcase
+        compression = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::COMPRESSION_COMPACT).upcase.to_sym
         unless org.apache.hadoop.hbase.io.compress.Compression::Algorithm.constants.include?(compression)
           raise(ArgumentError, "Compression #{compression} is not supported. Use one of "
+ org.apache.hadoop.hbase.io.compress.Compression::Algorithm.constants.join(" "))
         else
@@ -906,7 +909,7 @@ module Hbase
           family.setStoragePolicy(storage_policy)
       end
       if arg.include?(org.apache.hadoop.hbase.HColumnDescriptor::MOB_COMPACT_PARTITION_POLICY)
-        mob_partition_policy = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::MOB_COMPACT_PARTITION_POLICY).upcase
+        mob_partition_policy = arg.delete(org.apache.hadoop.hbase.HColumnDescriptor::MOB_COMPACT_PARTITION_POLICY).upcase.to_sym
         unless org.apache.hadoop.hbase.client.MobCompactPartitionPolicy.constants.include?(mob_partition_policy)
           raise(ArgumentError, "MOB_COMPACT_PARTITION_POLICY #{mob_partition_policy} is not
supported. Use one of " + org.apache.hadoop.hbase.client.MobCompactPartitionPolicy.constants.join("
"))
         else

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/hbase/security.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase/security.rb b/hbase-shell/src/main/ruby/hbase/security.rb
index 4c884d6..6dd1fe0 100644
--- a/hbase-shell/src/main/ruby/hbase/security.rb
+++ b/hbase-shell/src/main/ruby/hbase/security.rb
@@ -154,7 +154,7 @@ module Hbase
             yield(user_name, "#{namespace},#{table},#{family},#{qualifier}: #{action.to_s}")
           else
             res[user_name] ||= {}
-            res[user_name][family + ":" +qualifier] = action
+            res[user_name]["#{family}:#{qualifier}"] = action
           end
           count += 1
       end

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/hbase_constants.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/hbase_constants.rb b/hbase-shell/src/main/ruby/hbase_constants.rb
index 8f1b797..55806cf 100644
--- a/hbase-shell/src/main/ruby/hbase_constants.rb
+++ b/hbase-shell/src/main/ruby/hbase_constants.rb
@@ -27,9 +27,9 @@
 # whether the table exists and returns nil regardless.
 include Java
 
-include_class('java.lang.Integer') {|package,name| "J#{name}" }
-include_class('java.lang.Long') {|package,name| "J#{name}" }
-include_class('java.lang.Boolean') {|package,name| "J#{name}" }
+java_import('java.lang.Integer') { |_package, name| "J#{name}" }
+java_import('java.lang.Long') { |_package, name| "J#{name}" }
+java_import('java.lang.Boolean') { |_package, name| "J#{name}" }
 
 module HBaseConstants
   COLUMN = "COLUMN"

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/irb/hirb.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb b/hbase-shell/src/main/ruby/irb/hirb.rb
index b32e691..4d6d277 100644
--- a/hbase-shell/src/main/ruby/irb/hirb.rb
+++ b/hbase-shell/src/main/ruby/irb/hirb.rb
@@ -19,7 +19,7 @@
 require 'rbconfig'
 
 module IRB
-  WINDOZE = Config::CONFIG['host_os'] =~ /mswin|mingw/
+  WINDOZE = RbConfig::CONFIG['host_os'] =~ /mswin|mingw/
 
   # Subclass of IRB so can intercept methods
   class HIRB < Irb

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/shell/commands.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/commands.rb b/hbase-shell/src/main/ruby/shell/commands.rb
index 08f2e11..5f7a2e6 100644
--- a/hbase-shell/src/main/ruby/shell/commands.rb
+++ b/hbase-shell/src/main/ruby/shell/commands.rb
@@ -39,7 +39,9 @@ module Shell
         translate_hbase_exceptions(*args) { send(cmd, *args) }
       rescue => e
         rootCause = e
-        while rootCause != nil && rootCause.respond_to?(:cause) && rootCause.cause
!= nil
+
+        # JRuby9000 made RubyException respond to cause, ignore it for back compat
+        while !rootCause.is_a?(Exception) && rootCause.respond_to?(:cause) &&
!rootCause.cause.nil?
           rootCause = rootCause.cause
         end
         if @shell.interactive?
@@ -105,13 +107,8 @@ module Shell
 
       def translate_hbase_exceptions(*args)
         yield
-      rescue => e
-        # Since exceptions will be thrown from the java code, 'e' will always be NativeException.
-        # Check for the original java exception and use it if present.
-        raise e unless e.respond_to?(:cause) && e.cause != nil
-        cause = e.cause
-
-         # let individual command handle exceptions first
+      rescue => cause
+        # let individual command handle exceptions first
         if self.respond_to?(:handle_exceptions)
           self.handle_exceptions(cause, *args)
         end
@@ -153,7 +150,7 @@ module Shell
         end
 
         # Throw the other exception which hasn't been handled above
-        raise e
+        raise cause
       end
     end
   end

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/main/ruby/shell/formatter.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/main/ruby/shell/formatter.rb b/hbase-shell/src/main/ruby/shell/formatter.rb
index aa81c86..fb481e0 100644
--- a/hbase-shell/src/main/ruby/shell/formatter.rb
+++ b/hbase-shell/src/main/ruby/shell/formatter.rb
@@ -31,10 +31,13 @@ module Shell
       end
 
       def refresh_width()
+        @max_width = 0
         if $stdout.tty?
-          @max_width = Java::jline.Terminal.getTerminal().getTerminalWidth()
-        else
-          @max_width = 0
+          begin
+            @max_width = Java::jline.TerminalFactory.get.getWidth
+          rescue NameError => e
+            # nocommit debug log and ignore
+          end
         end
       end
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java
b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java
index 53606e9..7f67b01 100644
--- a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java
+++ b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/AbstractTestShell.java
@@ -58,7 +58,7 @@ public abstract class AbstractTestShell {
     List<String> loadPaths = new ArrayList<>(2);
     loadPaths.add("src/main/ruby");
     loadPaths.add("src/test/ruby");
-    jruby.getProvider().setLoadPaths(loadPaths);
+    jruby.setLoadPaths(loadPaths);
     jruby.put("$TEST_CLUSTER", TEST_UTIL);
     System.setProperty("jruby.jit.logging.verbose", "true");
     System.setProperty("jruby.jit.logging", "true");

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java
b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java
index 339f5a1..871240c 100644
--- a/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java
+++ b/hbase-shell/src/test/java/org/apache/hadoop/hbase/client/TestShellNoCluster.java
@@ -39,7 +39,7 @@ public class TestShellNoCluster extends AbstractTestShell {
     List<String> loadPaths = new ArrayList<>(2);
     loadPaths.add("src/main/ruby");
     loadPaths.add("src/test/ruby");
-    jruby.getProvider().setLoadPaths(loadPaths);
+    jruby.setLoadPaths(loadPaths);
     jruby.put("$TEST_CLUSTER", TEST_UTIL);
     System.setProperty("jruby.jit.logging.verbose", "true");
     System.setProperty("jruby.jit.logging", "true");

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java
b/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java
index 26da816..b81249b 100644
--- a/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java
+++ b/hbase-shell/src/test/rsgroup/org/apache/hadoop/hbase/client/rsgroup/TestShellRSGroups.java
@@ -77,7 +77,7 @@ public class TestShellRSGroups {
     List<String> loadPaths = new ArrayList<>(2);
     loadPaths.add(basePath+"/src/main/ruby");
     loadPaths.add(basePath+"/src/test/ruby");
-    jruby.getProvider().setLoadPaths(loadPaths);
+    jruby.setLoadPaths(loadPaths);
     jruby.put("$TEST_CLUSTER", TEST_UTIL);
     System.setProperty("jruby.jit.logging.verbose", "true");
     System.setProperty("jruby.jit.logging", "true");

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/hbase-shell/src/test/ruby/hbase/admin_test.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb
index 1884217..e42acde 100644
--- a/hbase-shell/src/test/ruby/hbase/admin_test.rb
+++ b/hbase-shell/src/test/ruby/hbase/admin_test.rb
@@ -248,8 +248,8 @@ module Hbase
     #-------------------------------------------------------------------------------
 
     define_test "describe should fail for non-existent tables" do
-      assert_raise(NativeException) do
-        admin.describe('.NOT.EXISTS.')
+      assert_raise(ArgumentError) do
+        admin.describe('NOT.EXISTS')
       end
     end
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/140ce145/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c66c93c..1751d2d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1262,7 +1262,7 @@
     <jersey.version>2.22.2</jersey.version>
     <jetty6.version>6.1.26</jetty6.version>
     <jetty.jspapi.version>6.1.14</jetty.jspapi.version>
-    <jruby.version>1.6.8</jruby.version>
+    <jruby.version>9.1.9.0</jruby.version>
     <junit.version>4.12</junit.version>
     <hamcrest.version>1.3</hamcrest.version>
     <htrace.version>3.1.0-incubating</htrace.version>
@@ -1280,8 +1280,9 @@
     <jettison.version>1.3.3</jettison.version>
     <netty.version>4.1.1.Final</netty.version>
     <netty.hadoop.version>3.6.2.Final</netty.hadoop.version>
-    <joni.version>2.1.2</joni.version>
-    <jcodings.version>1.0.8</jcodings.version>
+    <!--Make sure these joni/jcodings are compatible with the versions used by jruby-->
+    <joni.version>2.1.11</joni.version>
+    <jcodings.version>1.0.18</jcodings.version>
     <spy.version>2.11.6</spy.version>
     <bouncycastle.version>1.46</bouncycastle.version>
     <kerby.version>1.0.0-RC2</kerby.version>


Mime
View raw message