From 62db09cc797e94ff49ace2a31e5d7b325f72ca60 Mon Sep 17 00:00:00 2001 From: Mike Drob Date: Thu, 18 May 2017 09:32:40 -0700 Subject: [PATCH] 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 --- 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 | 399 +++++++++++++++------ .../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 | 2 +- 19 files changed, 373 insertions(+), 203 deletions(-) diff --git a/bin/draining_servers.rb b/bin/draining_servers.rb index 68496051cf..8a615a8c8f 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" diff --git a/bin/get-active-master.rb b/bin/get-active-master.rb index f7e1ff6793..bd303b3e41 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 diff --git a/bin/region_status.rb b/bin/region_status.rb index f889de9ec8..aab7e12f20 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 diff --git a/bin/replication/copy_tables_desc.rb b/bin/replication/copy_tables_desc.rb index a7cc3a3fd1..a265bf1403 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 diff --git a/bin/shutdown_regionserver.rb b/bin/shutdown_regionserver.rb index 608248f44a..9d514a717a 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 ..' 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 a9f0c814be..7eca8e439e 100644 --- a/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm +++ b/hbase-resource-bundle/src/main/resources/META-INF/LICENSE.vm @@ -1349,131 +1349,46 @@ 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 - * . - * - * 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: + + Copyright (c) 2000-2011 ymnk, JCraft,Inc. All rights reserved. + +The "rake" library (http://rake.rubyforge.org/) is distributed under + the MIT license (available above), and has the following copyright: -## 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) 2003, 2004 Jim Weirich - Redistribution and use in source and binary forms, with or - without modification, are permitted provided that the following - conditions are met: +## jruby bundles jcodings and joni, but we already ref that in our included deps - Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +Bouncycastle is released under the MIT license (available above), +and is Copyright (c) 2000 - 2006 The Legion Of The Bouncy Castle. - 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. +jnr-x86asm is distributed under the MIT license (available above), +with the following copyrights: - 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. + Copyright (C) 2010 Wayne Meissner + Copyright (c) 2008-2009, Petr Kobalicek - 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). +## 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 -## 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). +## Skip racc, json-generator, json-parser because it is under Ruby license +## jruby bundles jquery, but we already ref that above. Ruby is copyrighted free software by Yukihiro Matsumoto . You can redistribute it and/or modify it under either the terms of the GPL (see the file GPL), or the conditions below: @@ -1551,6 +1466,8 @@ You can redistribute it and/or modify it under either the terms of the GPL #set($bsd3 = []) ## gather up CPL 1.0 works #set($cpl = []) +## gather up EPL 1.0 works +#set($epl = []) ## track commons-math #set($commons-math-two = false) #set($commons-math-three = false) @@ -1647,6 +1564,9 @@ ${dep.scm.url} #if(${dep.licenses[0].name.equals("Common Public License Version 1.0")}) #set($aggregated = $cpl.add($dep)) #end +#if(${dep.licenses[0].name.equals("Eclipse Public License 1.0")}) +#set($aggregated = $epl.add($dep)) +#end #if(!${aggregated}) -- This product includes ${dep.name} licensed under the ${dep.licenses[0].name}. @@ -2569,7 +2489,262 @@ 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(!(${epl.isEmpty()})) +==== +## print all the EPL 1.0 licensed works +This product includes the following works licensed under the Eclipse Public License 1.0: + +#foreach($dep in $epl) +#if( !(${dep.licenses[0].comments.isEmpty()}) ) + * ${dep.name}, ${dep.licenses[0].comments} +#else + * ${dep.name} +#end +#end + + Eclipse Public License - v 1.0 + + THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE + PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION + OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. + + 1. DEFINITIONS + + "Contribution" means: + + a) in the case of the initial Contributor, the initial code and + documentation distributed under this Agreement, and + + b) in the case of each subsequent Contributor: + + i) changes to the Program, and + + ii) additions to the Program; + where such changes and/or additions to the Program + originate from and are distributed by that particular + Contributor. A Contribution 'originates' from a + Contributor if it was added to the Program by such + Contributor itself or anyone acting on such + Contributor's behalf. Contributions do not include + additions to the Program which: (i) are separate modules + of software distributed in conjunction with the Program + under their own license agreement, and (ii) are not + derivative works of the Program. + + "Contributor" means any person or entity that distributes the Program. + + "Licensed Patents" mean patent claims licensable by a Contributor + which are necessarily infringed by the use or sale of its + Contribution alone or when combined with the Program. + + "Program" means the Contributions distributed in accordance with + this Agreement. + + "Recipient" means anyone who receives the Program under this + Agreement, including all Contributors. + + 2. GRANT OF RIGHTS + + a) Subject to the terms of this Agreement, each Contributor + hereby grants Recipient a non-exclusive, worldwide, + royalty-free copyright license to reproduce, prepare + derivative works of, publicly display, publicly perform, + distribute and sublicense the Contribution of such + Contributor, if any, and such derivative works, in source + code and object code form. + + b) Subject to the terms of this Agreement, each Contributor + hereby grants Recipient a non-exclusive, worldwide, + royalty-free patent license under Licensed Patents to make, + use, sell, offer to sell, import and otherwise transfer the + Contribution of such Contributor, if any, in source code and + object code form. This patent license shall apply to the + combination of the Contribution and the Program if, at the + time the Contribution is added by the Contributor, such + addition of the Contribution causes such combination to be + covered by the Licensed Patents. The patent license shall not + apply to any other combinations which include the + Contribution. No hardware per se is licensed hereunder. + + c) Recipient understands that although each Contributor grants + the licenses to its Contributions set forth herein, no + assurances are provided by any Contributor that the Program + does not infringe the patent or other intellectual property + rights of any other entity. Each Contributor disclaims any + liability to Recipient for claims brought by any other entity + based on infringement of intellectual property rights or + otherwise. As a condition to exercising the rights and + licenses granted hereunder, each Recipient hereby assumes + sole responsibility to secure any other intellectual property + rights needed, if any. For example, if a third party patent + license is required to allow Recipient to distribute the + Program, it is Recipient's responsibility to acquire that + license before distributing the Program. + + d) Each Contributor represents that to its knowledge it has + sufficient copyright rights in its Contribution, if any, to + grant the copyright license set forth in this Agreement. + + 3. REQUIREMENTS + + A Contributor may choose to distribute the Program in object code + form under its own license agreement, provided that: + + a) it complies with the terms and conditions of this Agreement; and + + b) its license agreement: + + i) effectively disclaims on behalf of all Contributors all + warranties and conditions, express and implied, including + warranties or conditions of title and non-infringement, + and implied warranties or conditions of merchantability + and fitness for a particular purpose; + + ii) effectively excludes on behalf of all Contributors all + liability for damages, including direct, indirect, + special, incidental and consequential damages, such as + lost profits; + + iii) states that any provisions which differ from this + Agreement are offered by that Contributor alone and not + by any other party; and + + iv) states that source code for the Program is available + from such Contributor, and informs licensees how to + obtain it in a reasonable manner on or through a medium + customarily used for software exchange. + + When the Program is made available in source code form: + + a) it must be made available under this Agreement; and + + b) a copy of this Agreement must be included with each copy of + the Program. + + Contributors may not remove or alter any copyright notices contained + within the Program. + + Each Contributor must identify itself as the originator of its + Contribution, if any, in a manner that reasonably allows subsequent + Recipients to identify the originator of the Contribution. + + 4. COMMERCIAL DISTRIBUTION + + Commercial distributors of software may accept certain + responsibilities with respect to end users, business partners and + the like. While this license is intended to facilitate the + commercial use of the Program, the Contributor who includes the + Program in a commercial product offering should do so in a manner + which does not create potential liability for other Contributors. + Therefore, if a Contributor includes the Program in a commercial + product offering, such Contributor ("Commercial Contributor") hereby + agrees to defend and indemnify every other Contributor ("Indemnified + Contributor") against any losses, damages and costs (collectively + "Losses") arising from claims, lawsuits and other legal actions + brought by a third party against the Indemnified Contributor to the + extent caused by the acts or omissions of such Commercial + Contributor in connection with its distribution of the Program in a + commercial product offering. The obligations in this section do not + apply to any claims or Losses relating to any actual or alleged + intellectual property infringement. In order to qualify, an + Indemnified Contributor must: a) promptly notify the Commercial + Contributor in writing of such claim, and b) allow the Commercial + Contributor to control, and cooperate with the Commercial + Contributor in, the defense and any related settlement negotiations. + The Indemnified Contributor may participate in any such claim at its + own expense. + + For example, a Contributor might include the Program in a commercial + product offering, Product X. That Contributor is then a Commercial + Contributor. If that Commercial Contributor then makes performance + claims, or offers warranties related to Product X, those performance + claims and warranties are such Commercial Contributor's + responsibility alone. Under this section, the Commercial Contributor + would have to defend claims against the other Contributors related + to those performance claims and warranties, and if a court requires + any other Contributor to pay any damages as a result, the Commercial + Contributor must pay those damages. + + 5. NO WARRANTY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS + PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF + ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, + ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, + MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient + is solely responsible for determining the appropriateness of using + and distributing the Program and assumes all risks associated with + its exercise of rights under this Agreement , including but not + limited to the risks and costs of program errors, compliance with + applicable laws, damage to or loss of data, programs or equipment, + and unavailability or interruption of operations. + + 6. DISCLAIMER OF LIABILITY + + EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT + NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING WITHOUT LIMITATION LOST PROFITS), 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 OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS + GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH + DAMAGES. + + 7. GENERAL + + If any provision of this Agreement is invalid or unenforceable under + applicable law, it shall not affect the validity or enforceability + of the remainder of the terms of this Agreement, and without further + action by the parties hereto, such provision shall be reformed to + the minimum extent necessary to make such provision valid and + enforceable. + + If Recipient institutes patent litigation against any entity + (including a cross-claim or counterclaim in a lawsuit) alleging that + the Program itself (excluding combinations of the Program with other + software or hardware) infringes such Recipient's patent(s), then + such Recipient's rights granted under Section 2(b) shall terminate + as of the date such litigation is filed. + + All Recipient's rights under this Agreement shall terminate if it + fails to comply with any of the material terms or conditions of this + Agreement and does not cure such failure in a reasonable period of + time after becoming aware of such noncompliance. If all Recipient's + rights under this Agreement terminate, Recipient agrees to cease use + and distribution of the Program as soon as reasonably practicable. + However, Recipient's obligations under this Agreement and any + licenses granted by Recipient relating to the Program shall continue + and survive. + + Everyone is permitted to copy and distribute copies of this + Agreement, but in order to avoid inconsistency the Agreement is + copyrighted and may only be modified in the following manner. The + Agreement Steward reserves the right to publish new versions + (including revisions) of this Agreement from time to time. No one + other than the Agreement Steward has the right to modify this + Agreement. The Eclipse Foundation is the initial Agreement Steward. + The Eclipse Foundation may assign the responsibility to serve as the + Agreement Steward to a suitable separate entity. Each new version of + the Agreement will be given a distinguishing version number. The + Program (including Contributions) may always be distributed subject + to the version of the Agreement under which it was received. In + addition, after a new version of the Agreement is published, + Contributor may elect to distribute the Program (including its + Contributions) under the new version. Except as expressly stated in + Sections 2(a) and 2(b) above, Recipient receives no rights or + licenses to the intellectual property of any Contributor under this + Agreement, whether expressly, by implication, estoppel or otherwise. + All rights in the Program not expressly granted under this Agreement + are reserved. + + This Agreement is governed by the laws of the State of New York and + the intellectual property laws of the United States of America. No + party to this Agreement will bring a legal action under this + 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 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 4be6017c2e..c77ade53e7 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}) diff --git a/hbase-resource-bundle/src/main/resources/supplemental-models.xml b/hbase-resource-bundle/src/main/resources/supplemental-models.xml index ab9944377e..8765226738 100644 --- a/hbase-resource-bundle/src/main/resources/supplemental-models.xml +++ b/hbase-resource-bundle/src/main/resources/supplemental-models.xml @@ -2670,11 +2670,11 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice - Common Public License Version 1.0 - http://www-128.ibm.com/developerworks/library/os-cpl.html + Eclipse Public License 1.0 + http://www.eclipse.org/legal/epl-v10.html repo -Copyright (c) 2007-2011 The JRuby project +Copyright (c) 2007-2017 The JRuby project diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb b/hbase-shell/src/main/ruby/hbase/admin.rb index 749b2e8e4d..954758f897 100644 --- a/hbase-shell/src/main/ruby/hbase/admin.rb +++ b/hbase-shell/src/main/ruby/hbase/admin.rb @@ -75,9 +75,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 @@ -471,14 +471,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 @@ -852,7 +855,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 @@ -860,7 +863,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 @@ -878,7 +881,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 @@ -890,7 +893,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 diff --git a/hbase-shell/src/main/ruby/hbase/security.rb b/hbase-shell/src/main/ruby/hbase/security.rb index 4c884d6e01..6dd1fe0efc 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 diff --git a/hbase-shell/src/main/ruby/hbase_constants.rb b/hbase-shell/src/main/ruby/hbase_constants.rb index 52819c0c21..c1f13daf6c 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" diff --git a/hbase-shell/src/main/ruby/irb/hirb.rb b/hbase-shell/src/main/ruby/irb/hirb.rb index b32e691cf8..4d6d277172 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 diff --git a/hbase-shell/src/main/ruby/shell/commands.rb b/hbase-shell/src/main/ruby/shell/commands.rb index 08f2e11106..5f7a2e621f 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 diff --git a/hbase-shell/src/main/ruby/shell/formatter.rb b/hbase-shell/src/main/ruby/shell/formatter.rb index aa81c864c5..fb481e0ff1 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 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 140380502c..c6ef6e2138 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 @@ -57,7 +57,7 @@ public abstract class AbstractTestShell { List 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"); 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 339f5a1706..871240c2e1 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 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"); 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 26da8167c7..b81249b7fd 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 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"); diff --git a/hbase-shell/src/test/ruby/hbase/admin_test.rb b/hbase-shell/src/test/ruby/hbase/admin_test.rb index de2891bd85..9a5b749a62 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 diff --git a/pom.xml b/pom.xml index c66c93cb8c..005abd3ef9 100644 --- a/pom.xml +++ b/pom.xml @@ -1262,7 +1262,7 @@ 2.22.2 6.1.26 6.1.14 - 1.6.8 + 9.1.9.0 4.12 1.3 3.1.0-incubating -- 2.13.0